diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-08-16 19:01:07 +0200 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2012-08-16 22:38:42 +0200 |
commit | df0b1124cbb9f244dc40f435410ec16462a8fc9b (patch) | |
tree | b11e2a4de14cb1c80bf596ec891b38c1f50cf00a /tests | |
parent | be6227b52ac07b8df58f0f393026f3c4d51078a0 (diff) | |
download | factory-boy-df0b1124cbb9f244dc40f435410ec16462a8fc9b.tar factory-boy-df0b1124cbb9f244dc40f435410ec16462a8fc9b.tar.gz |
Mark automatic associated class discovery as deprecated.
Also improve warning reporting.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_base.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index f8ba605..5cbb31b 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -176,8 +176,10 @@ class FactoryCreationTestCase(unittest.TestCase): self.assertTrue(isinstance(TestFactory.build(), TestObject)) def testAutomaticAssociatedClassDiscovery(self): - class TestObjectFactory(base.Factory): - pass + with warnings.catch_warnings(): + warnings.simplefilter('ignore') + class TestObjectFactory(base.Factory): + pass self.assertTrue(isinstance(TestObjectFactory.build(), TestObject)) @@ -186,8 +188,7 @@ class FactoryCreationTestCase(unittest.TestCase): with warnings.catch_warnings(record=True) as w: # Clear the warning registry. - if hasattr(base, '__warningregistry__'): - base.__warningregistry__.clear() + __warningregistry__.clear() warnings.simplefilter('always') class TestObjectFactory(base.Factory): |