Michael Merickel
2017-04-02 a857ebbc65c0491f27d39c7a6c1ba485c99fee5d
add a failing test checking whether the threadlocal registry is active during config.include
1 files modified
10 ■■■■■ changed files
pyramid/tests/test_config/test_init.py 10 ●●●●● patch | view | raw | blame | history
pyramid/tests/test_config/test_init.py
@@ -817,6 +817,16 @@
        self.assertEqual(results['root_package'], tests)
        self.assertEqual(results['package'], test_config)
    def test_include_threadlocals_active(self):
        from pyramid.tests import test_config
        from pyramid.threadlocal import get_current_registry
        stack = []
        def include(config):
            stack.append(get_current_registry())
        config = self._makeOne()
        config.include(include)
        self.assertTrue(stack[0] is config.registry)
    def test_action_branching_kw_is_None(self):
        config = self._makeOne(autocommit=True)
        self.assertEqual(config.action('discrim'), None)