diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2009-05-25 14:00:38 -0400 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2009-05-25 14:00:38 -0400 |
commit | e430a6ba465e60062275b571654b61f99eb0c741 (patch) | |
tree | 6496aa67099f2ad11c24b4979faa31cf051695f1 /nose/config.py | |
parent | 6dbaeb13e92937dfa4a2755a202b8ad7b8c78d86 (diff) | |
download | nose-e430a6ba465e60062275b571654b61f99eb0c741.tar.gz |
Improved pickle-only config passing
Diffstat (limited to 'nose/config.py')
-rw-r--r-- | nose/config.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/nose/config.py b/nose/config.py index d08e714..0fc8c03 100644 --- a/nose/config.py +++ b/nose/config.py @@ -206,7 +206,8 @@ class Config(object): self.traverseNamespace = False self.firstPackageWins = False self.parserClass = OptionParser - + self.worker = False + self._default = self.__dict__.copy() self.update(kw) self._orig = self.__dict__.copy() @@ -218,8 +219,22 @@ class Config(object): del state['_default'] del state['env'] del state['logStream'] + # FIXME remove plugins, have only plugin manager class + state['plugins'] = self.plugins.__class__ return state + def __setstate__(self, state): + plugincls = state.pop('plugins') + self.update(state) + self.worker = True + # FIXME won't work for static plugin lists + self.plugins = plugincls() + self.plugins.loadPlugins() + # needed so .can_configure gets set appropriately + dummy_parser = self.parserClass() + self.plugins.addOptions(dummy_parser, {}) + self.plugins.configure(self.options, self) + def __repr__(self): d = self.__dict__.copy() # don't expose env, could include sensitive info |