diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-02-27 08:00:03 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-02-27 08:00:03 (GMT) |
commit | 1ed6be3793cf7e0964a8c345967064e915e13b78 (patch) | |
tree | 16d7162f231586021a0f651bdfba95a1da5a2256 /Lib/test/test_future.py | |
parent | c472c5d7bd2e2b347af650cf448bad71e33aa317 (diff) | |
download | cpython-1ed6be3793cf7e0964a8c345967064e915e13b78.zip cpython-1ed6be3793cf7e0964a8c345967064e915e13b78.tar.gz cpython-1ed6be3793cf7e0964a8c345967064e915e13b78.tar.bz2 |
#17303: test_future* now work with unittest test discovery. Patch by Zachary Ware.
Diffstat (limited to 'Lib/test/test_future.py')
-rw-r--r-- | Lib/test/test_future.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py index 3a25eb1..a0c156f 100644 --- a/Lib/test/test_future.py +++ b/Lib/test/test_future.py @@ -13,18 +13,18 @@ def get_error_location(msg): class FutureTest(unittest.TestCase): def test_future1(self): - support.unload('future_test1') - from test import future_test1 - self.assertEqual(future_test1.result, 6) + with support.CleanImport('future_test1'): + from test import future_test1 + self.assertEqual(future_test1.result, 6) def test_future2(self): - support.unload('future_test2') - from test import future_test2 - self.assertEqual(future_test2.result, 6) + with support.CleanImport('future_test2'): + from test import future_test2 + self.assertEqual(future_test2.result, 6) def test_future3(self): - support.unload('test_future3') - from test import test_future3 + with support.CleanImport('test_future3'): + from test import test_future3 def test_badfuture3(self): try: @@ -103,8 +103,8 @@ class FutureTest(unittest.TestCase): self.fail("syntax error didn't occur") def test_multiple_features(self): - support.unload("test.test_future5") - from test import test_future5 + with support.CleanImport("test.test_future5"): + from test import test_future5 def test_unicode_literals_exec(self): scope = {} @@ -112,8 +112,6 @@ class FutureTest(unittest.TestCase): self.assertIsInstance(scope["x"], str) -def test_main(): - support.run_unittest(FutureTest) if __name__ == "__main__": - test_main() + unittest.main() |