Allow disabling of python plugin

Fixes https://github.com/pytest-dev/pytest/issues/5277.
This commit is contained in:
Daniel Hahler
2019-05-16 16:30:40 +02:00
parent d94b4b031f
commit 93fd9debe3
5 changed files with 28 additions and 10 deletions

View File

@@ -60,7 +60,10 @@ class AssertionRewritingHook(object):
def __init__(self, config):
self.config = config
self.fnpats = config.getini("python_files")
try:
self.fnpats = config.getini("python_files")
except ValueError:
self.fnpats = ["test_*.py", "*_test.py"]
self.session = None
self.modules = {}
self._rewritten_names = set()