Join GitHub today
Assertion rewrite should match files completely and avoid rewriting setup.py #2939
diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py index d48b664..27026b0 100644 --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -168,7 +168,7 @@ class AssertionRewritingHook(object): return True for marked in self._must_rewrite: - if name.startswith(marked): + if name == marked or name.startswith(marked + '.'): state.trace("matched marked file %r (from %r)" % (name, marked)) return True
I'm finishing up the test.