Internal refactorings in order to support the new pytest-subtests plugin
Related to #1367
This commit is contained in:
@@ -15,6 +15,7 @@ import py
|
||||
|
||||
import pytest
|
||||
from _pytest.main import EXIT_NOTESTSCOLLECTED
|
||||
from _pytest.reports import BaseReport
|
||||
from _pytest.terminal import _plugin_nameversions
|
||||
from _pytest.terminal import build_summary_stats_line
|
||||
from _pytest.terminal import getreportopt
|
||||
@@ -1228,6 +1229,20 @@ def test_summary_stats(exp_line, exp_color, stats_arg):
|
||||
assert color == exp_color
|
||||
|
||||
|
||||
def test_skip_counting_towards_summary():
|
||||
class DummyReport(BaseReport):
|
||||
count_towards_summary = True
|
||||
|
||||
r1 = DummyReport()
|
||||
r2 = DummyReport()
|
||||
res = build_summary_stats_line({"failed": (r1, r2)})
|
||||
assert res == ("2 failed", "red")
|
||||
|
||||
r1.count_towards_summary = False
|
||||
res = build_summary_stats_line({"failed": (r1, r2)})
|
||||
assert res == ("1 failed", "red")
|
||||
|
||||
|
||||
class TestClassicOutputStyle(object):
|
||||
"""Ensure classic output style works as expected (#3883)"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user