mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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.
This commit is contained in:
parent
f089196beb
commit
51d8c526d5
5 changed files with 23 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue