Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Possible fix for view_config() referencing old registry #234
view_config decorators are called only once for an entire test suite execution.
This patch contains a test case to highlight the problem, and a proposed fix.
I have first observed the problem when trying to register some classes during integration testing, and using them for views registered via the view_config() decorator. The first test would pass, and the rest of the tests would fail.
I tracked the problem down to Renderer not picking up my registered renderers after testing.tearDown() is called. Eventually, view_config() turned out to be the cause.
I could have made a more targeted fix that would check config.registry and renderer.registry, and reallocate if they are different, but I chose to re-allocate a renderer every time config.scan() is called.