mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
use assert[Not]IsInstance where appropriate
This commit is contained in:
parent
f14c7fc33d
commit
b0f5adc3f4
57 changed files with 269 additions and 272 deletions
|
@ -14,11 +14,11 @@ class Tests(unittest.TestCase):
|
|||
|
||||
for s in snippets:
|
||||
a = transformer.parse(s)
|
||||
assert isinstance(a, ast.Module)
|
||||
self.assertIsInstance(a, ast.Module)
|
||||
child1 = a.getChildNodes()[0]
|
||||
assert isinstance(child1, ast.Stmt)
|
||||
self.assertIsInstance(child1, ast.Stmt)
|
||||
child2 = child1.getChildNodes()[0]
|
||||
assert isinstance(child2, ast.Assign)
|
||||
self.assertIsInstance(child2, ast.Assign)
|
||||
|
||||
# This actually tests the compiler, but it's a way to assure the ast
|
||||
# is correct
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue