Edgewall Software
Modify

Opened 8 years ago

Closed 8 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 EnvironmentStub for clearing and restoring the component registry: clear_component_registry and restore_component_registry.

Internal Changes:

Description (last modified by Ryan J Ollos)

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 Ryan J Ollos, 8 years ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 8 years ago

Description: modified (diff)

comment:3 by Ryan J Ollos, 8 years ago

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.

in reply to:  3 comment:4 by Christian Boos, 8 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 Ryan J Ollos, 8 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 Ryan J Ollos, 8 years ago

API Changes: modified (diff)
Resolution: fixed
Status: assignedclosed

Additional changes on 1.0-stable in [14639], merged to trunk in [14640].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.