diff options
| author | Chris McDonough <chrism@plope.com> | 2013-08-16 09:35:03 +0200 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2013-08-16 09:35:03 +0200 |
| commit | 061907bc6ce9c2f0c8421f32a767de971afccb1a (patch) | |
| tree | cfa42e8652c60061928e5f24a8b002a4c0a1560c | |
| parent | 0a973db36f6fa79b931b63fd52aac76432ef9879 (diff) | |
| download | pyramid-061907bc6ce9c2f0c8421f32a767de971afccb1a.tar.gz pyramid-061907bc6ce9c2f0c8421f32a767de971afccb1a.tar.bz2 pyramid-061907bc6ce9c2f0c8421f32a767de971afccb1a.zip | |
rename teststaticappbase to staticappbase so non-nose testrunner (e.g. pytest testrunner) wont pick it up as a test, tear down the global registries in a new teardown to avoid globals pollution seen when running under py.test testrunner
| -rw-r--r-- | pyramid/tests/test_integration.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pyramid/tests/test_integration.py b/pyramid/tests/test_integration.py index 66205e618..eda4ae9f3 100644 --- a/pyramid/tests/test_integration.py +++ b/pyramid/tests/test_integration.py @@ -72,7 +72,7 @@ class IntegrationBase(object): here = os.path.dirname(__file__) -class TestStaticAppBase(IntegrationBase): +class StaticAppBase(IntegrationBase): def test_basic(self): res = self.testapp.get('/minimal.pt', status=200) _assertBody(res.body, os.path.join(here, 'fixtures/minimal.pt')) @@ -198,10 +198,10 @@ class TestEventOnlySubscribers(IntegrationBase, unittest.TestCase): self.assertEqual(sorted(res.body.split()), [b'foobar', b'foobar2', b'foobaryup', b'foobaryup2']) -class TestStaticAppUsingAbsPath(TestStaticAppBase, unittest.TestCase): +class TestStaticAppUsingAbsPath(StaticAppBase, unittest.TestCase): package = 'pyramid.tests.pkgs.static_abspath' -class TestStaticAppUsingAssetSpec(TestStaticAppBase, unittest.TestCase): +class TestStaticAppUsingAssetSpec(StaticAppBase, unittest.TestCase): package = 'pyramid.tests.pkgs.static_assetspec' class TestStaticAppNoSubpath(unittest.TestCase): @@ -649,6 +649,10 @@ class AcceptContentTypeTest(unittest.TestCase): from webtest import TestApp self.testapp = TestApp(app) + def tearDown(self): + import pyramid.config + pyramid.config.global_registries.empty() + def test_ordering(self): res = self.testapp.get('/hello', headers={'Accept': 'application/json; q=1.0, text/plain; q=0.9'}, status=200) self.assertEqual(res.content_type, 'application/json') |
