Proposed changes in [c5641582/rjollos.git].
- I'll add more test coverage before committing changes.
- Documentation has been updated to describe the new features, see comment:11.
The changes include a new method ComponentMeta.deregister
. This aims to be a replacement for EnvironmentStub.clear_component_registry
and EnvironmentStub.restore_component_registry
. The downside to using those methods is that all components are removed from the registry, including those you may want to be active in the test case. clear_component_registry
must be called after the EnvironmentStub
is activated, so it doesn't allow selectively enabling/disabling components through the arguments to the initializer, instead it's necessary to call EnvironmentStub.enable_component
or define the test component class after the registry is cleared. With ComponentMeta.deregister
we can just cleanup the test components at the end of the test case, in tearDown
or tearDownClass
, and selectively enable/disable the built-in components that we want to be visible in the test case.