Skip to content

Commit f6ef057

Browse files
authored
Apply suggestions from code review
1 parent 964b5f9 commit f6ef057

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/_pytest/fixtures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ def parsefactories(
17251725
if holderobj in self._holderobjseen:
17261726
return
17271727

1728-
# avoid accessing `@property` (and other descriptors) when iterating fixtures
1728+
# Avoid accessing `@property` (and other descriptors) when iterating fixtures.
17291729
if not safe_isclass(holderobj) and not isinstance(holderobj, types.ModuleType):
17301730
holderobj_tp: object = type(holderobj)
17311731
else:
@@ -1742,7 +1742,7 @@ def parsefactories(
17421742
# fixture attribute.
17431743
continue
17441744

1745-
# ok we know it is a fixture -- now safe to look up on the _instance_
1745+
# OK we know it is a fixture -- now safe to look up on the _instance_.
17461746
obj = getattr(holderobj, name)
17471747

17481748
if marker.name:

testing/python/collect.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def prop(self):
264264
assert result.ret == ExitCode.NO_TESTS_COLLECTED
265265

266266
def test_does_not_discover_properties(self, pytester: Pytester) -> None:
267+
"""Regression test for #12446."""
267268
pytester.makepyfile(
268269
"""\
269270
class TestCase:
@@ -276,6 +277,7 @@ def oops(self):
276277
assert result.ret == ExitCode.NO_TESTS_COLLECTED
277278

278279
def test_does_not_discover_instance_descriptors(self, pytester: Pytester) -> None:
280+
"""Regression test for #12446."""
279281
pytester.makepyfile(
280282
"""\
281283
# not `@property`, but it acts like one

0 commit comments

Comments
 (0)