diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 06f0c095b..11ebc4472 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -454,7 +454,7 @@ class TmpTestdir: def _getpybinargs(self, scriptname): if not self.request.config.getvalue("notoolsonpath"): import pytest - script = pytest.__file__.strip("co") + script = pytest.__file__.rstrip("co") assert script, "script %r not found" % scriptname # XXX we rely on script refering to the correct environment # we cannot use "(py.std.sys.executable,script)"