Skip to content

Commit c802be2

Browse files
committed
refactor: @contract is completely gone
1 parent bc83e9c commit c802be2

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

coverage/env.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class PYBEHAVIOR:
132132

133133
# Are we running our test suite?
134134
# Even when running tests, you can use COVERAGE_TESTING=0 to disable the
135-
# test-specific behavior like contracts.
135+
# test-specific behavior like AST checking.
136136
TESTING = os.getenv('COVERAGE_TESTING', '') == 'True'
137137

138138

coverage/misc.py

-10
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,6 @@ def import_third_party(modname):
9191
return None
9292

9393

94-
# We don't use PyContracts anymore, but the @contracts decorators will be
95-
# useful info when it comes time to add type annotations, so keep them as
96-
# dummies for now.
97-
def contract(*args_unused, **kwargs_unused):
98-
"""Dummy no-op implementation of a decorator with arguments."""
99-
def _decorator(func):
100-
return func
101-
return _decorator
102-
103-
10494
def nice_pair(pair):
10595
"""Make a nice string representation of a pair of numbers.
10696

tests/test_venv.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def in_venv_world_fixture(self, venv_world):
178178
print(sum(colorsys.rgb_to_hls(1, 0, 0)))
179179
""")
180180

181-
self.del_environ("COVERAGE_TESTING") # To avoid needing contracts installed.
181+
self.del_environ("COVERAGE_TESTING") # To get realistic behavior
182182
self.set_environ("COVERAGE_DEBUG_FILE", "debug_out.txt")
183183
self.set_environ("COVERAGE_DEBUG", "trace")
184184

0 commit comments

Comments
 (0)