Avoid rewrite warning for inline runs

When running pytest inline/inprocess we plugins have already been
imported and re-writen, so avoid the warning.
This commit is contained in:
Floris Bruynooghe
2016-06-23 23:51:02 +02:00
parent a98e3cefc5
commit 944da5b98a
2 changed files with 14 additions and 4 deletions

View File

@@ -163,9 +163,9 @@ class AssertionRewritingHook(object):
self.session = session
del session
else:
for marked in self._must_rewrite:
if marked.startswith(name):
return True
toplevel_name = name.split('.', 1)[0]
if toplevel_name in self._must_rewrite:
return True
return False
def mark_rewrite(self, *names):