diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 0792da22810..a3c72dcbcf7 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1221,7 +1221,7 @@ def pyimport(self, modname=None, ensuresyspath=True): mod.__file__ = str(self) sys.modules[modname] = mod try: - with open(str(self), 'rb') as f: + with open(str(self), "rb") as f: exec(f.read(), mod.__dict__) except: del sys.modules[modname]