Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
> 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 <opensource@ronnypfannschmidt.de>
  • Loading branch information
davidszotten and RonnyPfannschmidt committed Oct 29, 2019
1 parent 96d8d0c commit c9a4d53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/_pytest/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def _test_pytest_function(pyfuncitem):
raise ValueError("--trace can't be used with a fixture named func!")
pyfuncitem.funcargs["func"] = testfunction
if "func" not in pyfuncitem._fixtureinfo.argnames:
# if using e.g. parametrize the _fixtureinfo is shared
# TODO: when using parameterized tests, the _fixtureinfo is shared
# that needs to move to FunctionDefinition
new_list = list(pyfuncitem._fixtureinfo.argnames)
new_list.append("func")
pyfuncitem._fixtureinfo.argnames = tuple(new_list)
Expand Down
2 changes: 1 addition & 1 deletion testing/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ def test_3():
assert "Exit: Quitting debugger" not in child.before.decode("utf8")
TestPDB.flush(child)

def test_trace_with_parametrize(self, testdir):
def test_trace_with_parametrize_handles_shared_fixtureinfo(self, testdir):
p1 = testdir.makepyfile(
"""
import pytest
Expand Down

0 comments on commit c9a4d53

Please sign in to comment.