* now showing pytest warnings summary by default.
* added ``--disable-pytest-warnings` flag to let users disable the warnings summary. * extended/changed unit tests for the changes in the pytest core.
This commit is contained in:
@@ -519,7 +519,7 @@ class TestWarning:
|
||||
""")
|
||||
result = testdir.runpytest()
|
||||
assert result.parseoutcomes()["pytest-warnings"] > 0
|
||||
assert "hello" not in result.stdout.str()
|
||||
assert "hello" in result.stdout.str()
|
||||
|
||||
result = testdir.runpytest("-rw")
|
||||
result.stdout.fnmatch_lines("""
|
||||
|
||||
@@ -591,6 +591,7 @@ def test_getreportopt():
|
||||
class config:
|
||||
class option:
|
||||
reportchars = ""
|
||||
disablepytestwarnings = True
|
||||
config.option.report = "xfailed"
|
||||
assert getreportopt(config) == "x"
|
||||
|
||||
@@ -601,12 +602,21 @@ def test_getreportopt():
|
||||
assert getreportopt(config) == "sx"
|
||||
|
||||
config.option.report = "skipped"
|
||||
config.option.reportchars = "sf"
|
||||
config.option.reportchars = "sfw"
|
||||
assert getreportopt(config) == "sf"
|
||||
|
||||
config.option.reportchars = "sfx"
|
||||
config.option.reportchars = "sfxw"
|
||||
assert getreportopt(config) == "sfx"
|
||||
|
||||
config.option.reportchars = "sfx"
|
||||
config.option.disablepytestwarnings = False
|
||||
assert getreportopt(config) == "sfxw"
|
||||
|
||||
config.option.reportchars = "sfxw"
|
||||
config.option.disablepytestwarnings = False
|
||||
assert getreportopt(config) == "sfxw"
|
||||
|
||||
|
||||
def test_terminalreporter_reportopt_addopts(testdir):
|
||||
testdir.makeini("[pytest]\naddopts=-rs")
|
||||
testdir.makepyfile("""
|
||||
|
||||
Reference in New Issue
Block a user