# HG changeset patch # User Denis Laxalde # Date 1490017162 -3600 # Node ID 4870e5a60a525fa38b91d62315bf2686e54e49c8 # Parent 82d2c1cdf0c20425a370db27282c072ae061beec [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(). diff -r 82d2c1cdf0c2 -r 4870e5a60a52 cubicweb/pyramid/__init__.py --- 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')