Skip Instances with --collect-only
This commit is contained in:
parent
87254ca593
commit
f551cb9677
|
@ -14,3 +14,5 @@ it was not really possible to detect when the functionality was being used expli
|
|||
The extra ``::()`` might have been removed in some places internally already,
|
||||
which then led to confusion in places where it was expected, e.g. with
|
||||
``--deselect`` (`#4127 <https://github.com/pytest-dev/pytest/issues/4127>`_).
|
||||
|
||||
Test class instances are also not listed with ``--collect-only`` anymore.
|
||||
|
|
|
@ -617,8 +617,8 @@ class TerminalReporter(object):
|
|||
stack.pop()
|
||||
for col in needed_collectors[len(stack) :]:
|
||||
stack.append(col)
|
||||
# if col.name == "()":
|
||||
# continue
|
||||
if col.name == "()": # Skip Instances.
|
||||
continue
|
||||
indent = (len(stack) - 1) * " "
|
||||
self._tw.line("%s%s" % (indent, col))
|
||||
|
||||
|
|
|
@ -1408,9 +1408,7 @@ def test_customize_through_attributes(testdir):
|
|||
"""
|
||||
)
|
||||
result = testdir.runpytest("--collect-only")
|
||||
result.stdout.fnmatch_lines(
|
||||
["*MyClass*", "*MyInstance*", "*MyFunction*test_hello*"]
|
||||
)
|
||||
result.stdout.fnmatch_lines(["*MyClass*", "*MyFunction*test_hello*"])
|
||||
|
||||
|
||||
def test_unorderable_types(testdir):
|
||||
|
|
Loading…
Reference in New Issue