diff options
Diffstat (limited to 'coverage')
-rw-r--r-- | coverage/env.py | 1 | ||||
-rw-r--r-- | coverage/misc.py | 10 | ||||
-rw-r--r-- | coverage/parser.py | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/coverage/env.py b/coverage/env.py index 96143dc7..19eb5530 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -135,7 +135,6 @@ METACOV = os.getenv('COVERAGE_COVERAGE', '') != '' # test-specific behavior like contracts. TESTING = os.getenv('COVERAGE_TESTING', '') == 'True' -USE_CONTRACTS = False def debug_info(): """Return a list of (name, value) pairs for printing debug information.""" diff --git a/coverage/misc.py b/coverage/misc.py index 34b743dc..fe59ef6d 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -91,18 +91,16 @@ def import_third_party(modname): return None -def dummy_decorator_with_args(*args_unused, **kwargs_unused): +# We don't use PyContracts anymore, but the @contracts decorators will be +# useful info when it comes time to add type annotations, so keep them as +# dummies for now. +def contract(*args_unused, **kwargs_unused): """Dummy no-op implementation of a decorator with arguments.""" def _decorator(func): return func return _decorator -# We aren't using real PyContracts, so just define our decorators as -# stunt-double no-ops. -contract = dummy_decorator_with_args -one_of = dummy_decorator_with_args - def new_contract(*args_unused, **kwargs_unused): """Dummy no-op implementation of `new_contract`.""" pass diff --git a/coverage/parser.py b/coverage/parser.py index 1bf1951a..044839d8 100644 --- a/coverage/parser.py +++ b/coverage/parser.py @@ -14,7 +14,7 @@ from coverage import env from coverage.bytecode import code_objects from coverage.debug import short_stack from coverage.exceptions import NoSource, NotPython, _StopEverything -from coverage.misc import contract, join_regex, new_contract, nice_pair, one_of +from coverage.misc import contract, join_regex, new_contract, nice_pair from coverage.phystokens import generate_tokens @@ -778,7 +778,6 @@ class AstArcAnalyzer: # Default for simple statements: one exit from this node. return {ArcStart(self.line_for_node(node))} - @one_of("from_start, prev_starts") @contract(returns='ArcStarts') def add_body_arcs(self, body, from_start=None, prev_starts=None): """Add arcs for the body of a compound statement. |