diff options
author | David Douard <david.douard@logilab.fr> | 2014-11-30 11:12:22 +0100 |
---|---|---|
committer | David Douard <david.douard@logilab.fr> | 2014-11-30 11:12:22 +0100 |
commit | 49f441b56a6235baf6f33b97600a005456f2a443 (patch) | |
tree | f1f32b2930c620897d814376fee03b5f11752d3f | |
parent | 93251cb8463691aa644f808e9295625d5ad89adb (diff) | |
download | logilab-common-49f441b56a6235baf6f33b97600a005456f2a443.tar.gz |
[coverage] fix a bug breaking coverage.py (closes #281908)
The refactoring of the coverage suspend/resume tools in pytest done in
31725b8fa3f5 breaks the compatibility of theses tools with coverage.py,
due to a bug in this later project, see:
https://bitbucket.org/ned/coveragepy/issue/123
-rw-r--r-- | pytest.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -157,6 +157,11 @@ def replace_trace(trace=None): try: yield finally: + # specific hack to work around a bug in pycoverage, see + # https://bitbucket.org/ned/coveragepy/issue/123 + if (oldtrace is not None and not callable(oldtrace) and + hasattr(oldtrace, 'pytrace')): + oldtrace = oldtrace.pytrace sys.settrace(oldtrace) |