Skip to content

Commit c9a4d53

Browse files
Apply suggestions from code review
> RonnyPfannschmidt > >practically this belongs to the FunctionDefininition (and should only happen once at that) >unfortunately with the current design that's not exposed and we have a hack instead > >the ""correct" fix is not to have more than one place where this is added, but that's for after FunctionDefinition lands Co-Authored-By: Ronny Pfannschmidt <[email protected]>
1 parent 96d8d0c commit c9a4d53

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/_pytest/debugging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ def _test_pytest_function(pyfuncitem):
279279
raise ValueError("--trace can't be used with a fixture named func!")
280280
pyfuncitem.funcargs["func"] = testfunction
281281
if "func" not in pyfuncitem._fixtureinfo.argnames:
282-
# if using e.g. parametrize the _fixtureinfo is shared
282+
# TODO: when using parameterized tests, the _fixtureinfo is shared
283+
# that needs to move to FunctionDefinition
283284
new_list = list(pyfuncitem._fixtureinfo.argnames)
284285
new_list.append("func")
285286
pyfuncitem._fixtureinfo.argnames = tuple(new_list)

testing/test_pdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ def test_3():
10251025
assert "Exit: Quitting debugger" not in child.before.decode("utf8")
10261026
TestPDB.flush(child)
10271027

1028-
def test_trace_with_parametrize(self, testdir):
1028+
def test_trace_with_parametrize_handles_shared_fixtureinfo(self, testdir):
10291029
p1 = testdir.makepyfile(
10301030
"""
10311031
import pytest

0 commit comments

Comments
 (0)