diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-02-08 16:57:02 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-02-08 16:57:02 (GMT) |
commit | 51d8c526d5634fa1f0e4976fd357c5423a792082 (patch) | |
tree | 5aaa710f4f336f949691c88f70a221169ccc42f8 /Lib/test/test_support.py | |
parent | f089196beb0ad8fb262be42eddd92af3f0fe81c1 (diff) | |
download | cpython-51d8c526d5634fa1f0e4976fd357c5423a792082.zip cpython-51d8c526d5634fa1f0e4976fd357c5423a792082.tar.gz cpython-51d8c526d5634fa1f0e4976fd357c5423a792082.tar.bz2 |
Replace noop constant statement with expression
* Constant statements will be ignored and the compiler will emit a
SyntaxWarning.
* Replace constant statement (ex: "1") with an expression statement
(ex: "x=1").
* test_traceback: use context manager on the file.
Issue #26204.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r-- | Lib/test/test_support.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index f86ea91..269d9bf 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -230,7 +230,8 @@ class TestSupport(unittest.TestCase): def test_check_syntax_error(self): support.check_syntax_error(self, "def class") - self.assertRaises(AssertionError, support.check_syntax_error, self, "1") + with self.assertRaises(AssertionError): + support.check_syntax_error(self, "x=1") def test_CleanImport(self): import importlib |