[pyramid] Do not register repository.shutdown atexit in test mode
It seems that there already is a special shutdown step for repository in test
mode and pyramid's atexit handler interferes with it leading to assertion
error about 'shutting_down' attribute being True in Repository.shutdown().
--- a/cubicweb/pyramid/__init__.py Tue Mar 21 14:17:26 2017 +0100
+++ b/cubicweb/pyramid/__init__.py Mon Mar 20 14:39:22 2017 +0100
@@ -226,7 +226,8 @@
repo = config.registry['cubicweb.repository'] = cwconfig.repository()
config.registry['cubicweb.registry'] = repo.vreg
- atexit.register(repo.shutdown)
+ if cwconfig.mode != 'test':
+ atexit.register(repo.shutdown)
if asbool(config.registry.settings.get('cubicweb.defaults', True)):
config.include('cubicweb.pyramid.defaults')