diff options
author | Mariatta Wijaya <mariatta.wijaya@gmail.com> | 2017-02-06 20:16:58 -0800 |
---|---|---|
committer | Mariatta Wijaya <mariatta.wijaya@gmail.com> | 2017-02-06 20:16:58 -0800 |
commit | da79bcf8ac7ae72218ab023e1ed54390bc1a3a27 (patch) | |
tree | 74845e2dbd9521d9748b9c32f1922f4123083bf3 /Lib/test/test_support.py | |
parent | e3c7e835bdfc97750eb9b7fc0ad2493108c2d438 (diff) | |
parent | 1fe806ac56f8b83694d24ab604eb695d00bc8497 (diff) | |
download | cpython-da79bcf8ac7ae72218ab023e1ed54390bc1a3a27.tar.gz |
Issue #29371: merge with 3.5
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r-- | Lib/test/test_support.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 5e0f990e40..e83a4d6426 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -241,9 +241,8 @@ class TestSupport(unittest.TestCase): def test_check_syntax_error(self): support.check_syntax_error(self, "def class", lineno=1, offset=9) - self.assertRaises(AssertionError, support.check_syntax_error, self, "1") - #with self.assertRaises(AssertionError): - #support.check_syntax_error(self, "x=1") + with self.assertRaises(AssertionError): + support.check_syntax_error(self, "x=1") def test_CleanImport(self): import importlib @@ -327,6 +326,28 @@ class TestSupport(unittest.TestCase): self.OtherClass, self.RefClass, ignore=ignore) self.assertEqual(set(), missing_items) + def test_check__all__(self): + extra = {'tempdir'} + blacklist = {'template'} + support.check__all__(self, + tempfile, + extra=extra, + blacklist=blacklist) + + extra = {'TextTestResult', 'installHandler'} + blacklist = {'load_tests', "TestProgram", "BaseTestSuite"} + + support.check__all__(self, + unittest, + ("unittest.result", "unittest.case", + "unittest.suite", "unittest.loader", + "unittest.main", "unittest.runner", + "unittest.signals"), + extra=extra, + blacklist=blacklist) + + self.assertRaises(AssertionError, support.check__all__, self, unittest) + # XXX -follows a list of untested API # make_legacy_pyc # is_resource_enabled |