* 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:
aostr
2016-06-25 18:16:13 +02:00
parent 9a5224e2f8
commit e04d9ff80b
5 changed files with 29 additions and 5 deletions

View File

@@ -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("""

View File

@@ -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("""