This means that we're capturing the value of pkg_resources.working_set at import time, and using that value as the default for each EggPluginManager.
For testing purposes, it's convenient to be able to use a temporary replacement working set for pkg_resources.working_set to avoid test interactions. But this currently doesn't work.
This PR changes the working_set trait so that it looks up pkg_resources.working_set on first use, on a per-EggPluginManager-instance basis, instead of doing that lookup just once at import time.
The
EggPluginManager
uses the following trait definition for its working set:This means that we're capturing the value of
pkg_resources.working_set
at import time, and using that value as the default for eachEggPluginManager
.For testing purposes, it's convenient to be able to use a temporary replacement working set for
pkg_resources.working_set
to avoid test interactions. But this currently doesn't work.This PR changes the
working_set
trait so that it looks uppkg_resources.working_set
on first use, on a per-EggPluginManager
-instance basis, instead of doing that lookup just once at import time.