diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-06-04 12:13:16 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-06-05 13:56:25 -0400 |
commit | 69e9a61f28853e2e79f9711b97b7ce4f57e834ed (patch) | |
tree | d7e5862aff7e6d35ce13dd527c5909365dc6451b /coverage | |
parent | 1a5cd1aa1e4852fd01848e1187224c3d6160bf6b (diff) | |
download | python-coveragepy-git-69e9a61f28853e2e79f9711b97b7ce4f57e834ed.tar.gz |
test: add a test for annotated assignment
Every statement-level ast node should be tested. Annotated assignment
was missing.
Also, we don't need "exec" anymore, that was only for Python 2.
And: this is the 1000th test!
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/parser.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/coverage/parser.py b/coverage/parser.py index e4c86703..1c6e995a 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -708,7 +708,7 @@ class AstArcAnalyzer: # The node types that just flow to the next node with no complications. OK_TO_DEFAULT = { - "Assign", "Assert", "AugAssign", "Delete", "Exec", "Expr", "Global", + "AnnAssign", "Assign", "Assert", "AugAssign", "Delete", "Expr", "Global", "Import", "ImportFrom", "Nonlocal", "Pass", } @@ -904,6 +904,9 @@ class AstArcAnalyzer: # also call self.add_arc to record arcs they find. These functions mirror # the Python semantics of each syntactic construct. See the docstring # for add_arcs to understand the concept of exits from a node. + # + # Every node type that represents a statement should have a handler, or it + # should be listed in OK_TO_DEFAULT. @contract(returns='ArcStarts') def _handle__Break(self, node): |