-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously
Description
def test_regression_demo(testdir):
testdir.makefile("tests.py", "# python file contents\n")
This works under pytest 6.1.2, but fails under 6.2.x - i.e. following #7854 - with
____________________________ test_regression_demo _____________________________
Traceback (most recent call last):
File "t.py", line 2, in test_regression_demo
testdir.makefile("tests.py", "# python file contents/n")
File "site-packages/_pytest/pytester.py", line 1547, in makefile
return py.path.local(str(self._pytester.makefile(ext, *args, **kwargs)))
File "site-packages/_pytest/pytester.py", line 788, in makefile
return self._makefile(ext, args, kwargs)
File "site-packages/_pytest/pytester.py", line 756, in _makefile
p = self.path.joinpath(basename).with_suffix(ext)
File "lib/pathlib.py", line 889, in with_suffix
raise ValueError("Invalid suffix %r" % (suffix))
ValueError: Invalid suffix 'tests.py'
I think the new behaviour for pytester
is fine, but the compatibility layer seems to need a little work.
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortopic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously