Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions endpoint_route_handler/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ def _get_mocked_request(
setattr(mocked_request, k, v)
mocked_request.make_response = lambda data, **kw: data
mocked_request.registry._init_modules = set()
yield mocked_request
# Restore the real _init_modules.
# Without this, routing_map() keeps being built with an empty module
# set and post_install HttpCase tests in other modules get 404s.
registry._init_modules = original_init_modules
try:
yield mocked_request
finally:
# Restore the real _init_modules.
# Without this, routing_map() keeps being built with an empty
# module set and post_install HttpCase tests in other modules
# get 404s.
registry._init_modules = original_init_modules
Loading