Opened 9 years ago
Closed 9 years ago
#12405 closed enhancement (fixed)
Add methods to EnvironmentStub to clear and restore Component registry
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.11 |
Component: | general | Version: | |
Severity: | normal | Keywords: | test |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: |
Added methods to |
||
Internal Changes: |
Description (last modified by )
The proposed changes in [c5798f0c/rjollos.git] extract code from TestCase
setUp
methods to methods of the EnvironmentStub
class.
Attachments (0)
Change History (6)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
follow-up: 4 comment:3 by , 9 years ago
comment:4 by , 9 years ago
Replying to Ryan J Ollos:
Would the following changes make also sense?: log:rjollos.git:t12405_clear_restore_registry.1.
I think it's better to keep trac/tests/core.py with as little external dependencies as possible. If something goes wrong in a test there, we can just focus on the trac.core part, not worry about the EnvironmentStub or the whole trac.env layer. trac.core is pretty unique in that, as for nearly everything else trac.env would be a necessary dependency and then it's not a big deal to also depend on EnvironmentStub.
Think about people stealing our lovely component architecture, they can just grab trac.core, trac.tests.core ;-)
comment:5 by , 9 years ago
That makes sense, I'll discard the change [7cb41fe5/rjollos.git].
I'm not very familiar with the Component architecture, but I'm wondering if it make sense to save/restore the ComponentMeta._components
along with ComponentMeta._registry
: [b94c1318/rjollos.git]. Are any use cases foreseen?
comment:6 by , 9 years ago
API Changes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Committed changes to 1.0-stable in [14602], merged in [14603].
Would the following changes make also sense?: log:rjollos.git:t12405_clear_restore_registry.1.