tests: remove unnecessary `-rw` option

Warnings are enabled by default, which is tested by `test_getreportopt`.
This commit is contained in:
Daniel Hahler 2020-01-23 11:35:35 +01:00
parent eb7a57f965
commit e7444bbd5e
5 changed files with 12 additions and 12 deletions

View File

@ -68,7 +68,7 @@ class TestModule:
def test_invalid_test_module_name(self, testdir): def test_invalid_test_module_name(self, testdir):
a = testdir.mkdir("a") a = testdir.mkdir("a")
a.ensure("test_one.part1.py") a.ensure("test_one.part1.py")
result = testdir.runpytest("-rw") result = testdir.runpytest()
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(
[ [
"ImportError while importing test module*test_one.part1*", "ImportError while importing test module*test_one.part1*",
@ -137,7 +137,7 @@ class TestClass:
pass pass
""" """
) )
result = testdir.runpytest("-rw") result = testdir.runpytest()
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(
[ [
"*cannot collect test class 'TestClass1' because it has " "*cannot collect test class 'TestClass1' because it has "
@ -153,7 +153,7 @@ class TestClass:
pass pass
""" """
) )
result = testdir.runpytest("-rw") result = testdir.runpytest()
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(
[ [
"*cannot collect test class 'TestClass1' because it has " "*cannot collect test class 'TestClass1' because it has "
@ -230,7 +230,7 @@ class TestClass:
TestCase = collections.namedtuple('TestCase', ['a']) TestCase = collections.namedtuple('TestCase', ['a'])
""" """
) )
result = testdir.runpytest("-rw") result = testdir.runpytest()
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(
"*cannot collect test class 'TestCase' " "*cannot collect test class 'TestCase' "
"because it has a __new__ constructor*" "because it has a __new__ constructor*"
@ -1162,7 +1162,7 @@ def test_dont_collect_non_function_callable(testdir):
pass pass
""" """
) )
result = testdir.runpytest("-rw") result = testdir.runpytest()
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(
[ [
"*collected 1 item*", "*collected 1 item*",

View File

@ -1349,7 +1349,7 @@ def test_assert_indirect_tuple_no_warning(testdir):
assert tpl assert tpl
""" """
) )
result = testdir.runpytest("-rw") result = testdir.runpytest()
output = "\n".join(result.stdout.lines) output = "\n".join(result.stdout.lines)
assert "WR1" not in output assert "WR1" not in output

View File

@ -66,7 +66,7 @@ class TestNewAPI:
testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0) testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0)
try: try:
testdir.makepyfile("def test_error(): raise Exception") testdir.makepyfile("def test_error(): raise Exception")
result = testdir.runpytest("-rw") result = testdir.runpytest()
assert result.ret == 1 assert result.ret == 1
# warnings from nodeids, lastfailed, and stepwise # warnings from nodeids, lastfailed, and stepwise
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(

View File

@ -1061,7 +1061,7 @@ def test_record_property(testdir, run_and_parse):
record_property("foo", "<1"); record_property("foo", "<1");
""" """
) )
result, dom = run_and_parse("-rw") result, dom = run_and_parse()
node = dom.find_first_by_tag("testsuite") node = dom.find_first_by_tag("testsuite")
tnode = node.find_first_by_tag("testcase") tnode = node.find_first_by_tag("testcase")
psnode = tnode.find_first_by_tag("properties") psnode = tnode.find_first_by_tag("properties")
@ -1079,7 +1079,7 @@ def test_record_property_same_name(testdir, run_and_parse):
record_property("foo", "baz") record_property("foo", "baz")
""" """
) )
result, dom = run_and_parse("-rw") result, dom = run_and_parse()
node = dom.find_first_by_tag("testsuite") node = dom.find_first_by_tag("testsuite")
tnode = node.find_first_by_tag("testcase") tnode = node.find_first_by_tag("testcase")
psnode = tnode.find_first_by_tag("properties") psnode = tnode.find_first_by_tag("properties")
@ -1121,7 +1121,7 @@ def test_record_attribute(testdir, run_and_parse):
record_xml_attribute("foo", "<1"); record_xml_attribute("foo", "<1");
""" """
) )
result, dom = run_and_parse("-rw") result, dom = run_and_parse()
node = dom.find_first_by_tag("testsuite") node = dom.find_first_by_tag("testsuite")
tnode = node.find_first_by_tag("testcase") tnode = node.find_first_by_tag("testcase")
tnode.assert_attr(bar="1") tnode.assert_attr(bar="1")
@ -1156,7 +1156,7 @@ def test_record_fixtures_xunit2(testdir, fixture_name, run_and_parse):
) )
) )
result, dom = run_and_parse("-rw", family=None) result, dom = run_and_parse(family=None)
expected_lines = [] expected_lines = []
if fixture_name == "record_xml_attribute": if fixture_name == "record_xml_attribute":
expected_lines.append( expected_lines.append(

View File

@ -256,7 +256,7 @@ class TestPytestPluginManager:
) )
p.copy(p.dirpath("skipping2.py")) p.copy(p.dirpath("skipping2.py"))
monkeypatch.setenv("PYTEST_PLUGINS", "skipping2") monkeypatch.setenv("PYTEST_PLUGINS", "skipping2")
result = testdir.runpytest("-rw", "-p", "skipping1", syspathinsert=True) result = testdir.runpytest("-p", "skipping1", syspathinsert=True)
assert result.ret == ExitCode.NO_TESTS_COLLECTED assert result.ret == ExitCode.NO_TESTS_COLLECTED
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(
["*skipped plugin*skipping1*hello*", "*skipped plugin*skipping2*hello*"] ["*skipped plugin*skipping1*hello*", "*skipped plugin*skipping2*hello*"]