From 16e1a65f5b93615d946b74e3fb4d0b61c99ae0d2 Mon Sep 17 00:00:00 2001 From: Raphaƫl Barrois Date: Mon, 11 Mar 2013 22:30:45 +0100 Subject: Remove CircularSubFactory. Replace CircularSubFactory('module', 'symbol') with SubFactory('module.symbol'). --- tests/test_declarations.py | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'tests/test_declarations.py') diff --git a/tests/test_declarations.py b/tests/test_declarations.py index 2e527af..ceadafa 100644 --- a/tests/test_declarations.py +++ b/tests/test_declarations.py @@ -363,49 +363,5 @@ class PostGenerationMethodCallTestCase(unittest.TestCase): -class CircularSubFactoryTestCase(unittest.TestCase): - - def test_circularsubfactory_deprecated(self): - with warnings.catch_warnings(record=True) as w: - __warningregistry__.clear() - - warnings.simplefilter('always') - declarations.CircularSubFactory('datetime', 'date') - - self.assertEqual(1, len(w)) - self.assertIn('CircularSubFactory', str(w[0].message)) - self.assertIn('deprecated', str(w[0].message)) - - @tools.disable_warnings - def test_lazyness(self): - f = declarations.CircularSubFactory('factory.declarations', 'Sequence', x=3) - self.assertEqual(None, f.factory) - - self.assertEqual({'x': 3}, f.defaults) - - factory_class = f.get_factory() - self.assertEqual(declarations.Sequence, factory_class) - - @tools.disable_warnings - def test_cache(self): - orig_date = datetime.date - f = declarations.CircularSubFactory('datetime', 'date') - self.assertEqual(None, f.factory) - - factory_class = f.get_factory() - self.assertEqual(orig_date, factory_class) - - try: - # Modify original value - datetime.date = None - # Repeat import - factory_class = f.get_factory() - self.assertEqual(orig_date, factory_class) - - finally: - # IMPORTANT: restore attribute. - datetime.date = orig_date - - if __name__ == '__main__': unittest.main() -- cgit v1.2.3