Skip to content

Commit

Permalink
Apply bluetech suggestions on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed May 16, 2020
1 parent c145437 commit 3e44a10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,9 @@ def __init__(
#: parametrization adds a ``"[...]"`` suffix to function names).
#:
#: .. versionadded:: 3.0
self.originalname = originalname if originalname is not None else name
self.originalname = originalname or name
# note: when FunctionDefinition is introduced, we should change this to a readonly
# property that returns FunctionDefinition.name

self.keywords.update(self.obj.__dict__)
self.own_markers.extend(get_unpacked_marks(self.obj))
Expand Down
2 changes: 1 addition & 1 deletion testing/python/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def test_no_param():
]

def test_function_with_square_brackets(self, testdir: Testdir) -> None:
"""Check that Function._getobj uses originalname."""
"""Check that functions with square brackets don't cause trouble."""
p1 = testdir.makepyfile(
"""
locals()["test_foo[name]"] = lambda: None
Expand Down

0 comments on commit 3e44a10

Please sign in to comment.