From 33f1ff4e8cb49f05c0fe8df38765741e926dd12e Mon Sep 17 00:00:00 2001 From: Niclas Olofsson Date: Sat, 26 Sep 2015 14:59:28 +0200 Subject: [PATCH] Use result.stderr in tests since result.errlines has changed behaviour. --- tests/test_pytest_stepwise.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_pytest_stepwise.py b/tests/test_pytest_stepwise.py index 96b376c3f..1d0c4e8a8 100644 --- a/tests/test_pytest_stepwise.py +++ b/tests/test_pytest_stepwise.py @@ -60,7 +60,6 @@ def broken_testdir(testdir): def test_run_without_stepwise(stepwise_testdir): result = stepwise_testdir.runpytest('-v', '--strict', '--fail') - assert not result.errlines result.stdout.fnmatch_lines(['*test_success_before_fail PASSED*']) result.stdout.fnmatch_lines(['*test_fail_on_flag FAILED*']) result.stdout.fnmatch_lines(['*test_success_after_fail PASSED*']) @@ -69,7 +68,7 @@ def test_run_without_stepwise(stepwise_testdir): def test_fail_and_continue_with_stepwise(stepwise_testdir): # Run the tests with a failing second test. result = stepwise_testdir.runpytest('-v', '--strict', '--stepwise', '--fail') - assert not result.errlines + assert not result.stderr.str() stdout = result.stdout.str() # Make sure we stop after first failing test. @@ -79,7 +78,7 @@ def test_fail_and_continue_with_stepwise(stepwise_testdir): # "Fix" the test that failed in the last run and run it again. result = stepwise_testdir.runpytest('-v', '--strict', '--stepwise') - assert not result.errlines + assert not result.stderr.str() stdout = result.stdout.str() # Make sure the latest failing test runs and then continues. @@ -91,7 +90,7 @@ def test_fail_and_continue_with_stepwise(stepwise_testdir): def test_run_with_skip_option(stepwise_testdir): result = stepwise_testdir.runpytest('-v', '--strict', '--stepwise', '--skip', '--fail', '--fail-last') - assert not result.errlines + assert not result.stderr.str() stdout = result.stdout.str() # Make sure first fail is ignore and second fail stops the test run. @@ -104,7 +103,7 @@ def test_run_with_skip_option(stepwise_testdir): def test_fail_on_errors(error_testdir): result = error_testdir.runpytest('-v', '--strict', '--stepwise') - assert not result.errlines + assert not result.stderr.str() stdout = result.stdout.str() assert 'test_error ERROR' in stdout @@ -114,7 +113,7 @@ def test_fail_on_errors(error_testdir): def test_change_testfile(stepwise_testdir): result = stepwise_testdir.runpytest('-v', '--strict', '--stepwise', '--fail', 'test_stepwise.py') - assert not result.errlines + assert not result.stderr.str() stdout = result.stdout.str() assert 'test_fail_on_flag FAILED' in stdout @@ -123,7 +122,7 @@ def test_change_testfile(stepwise_testdir): # test to continue from does not exist in testfile_b. result = stepwise_testdir.runpytest('-v', '--strict', '--stepwise', 'testfile_b.py') - assert not result.errlines + assert not result.stderr.str() stdout = result.stdout.str() assert 'test_success PASSED' in stdout