Implement progress percentage reporting while running tests

Fix #2657
This commit is contained in:
Bruno Oliveira
2017-09-27 14:42:55 -03:00
parent 7a7cb8c8c5
commit dab889304e
8 changed files with 81 additions and 27 deletions

View File

@@ -2119,6 +2119,10 @@ class TestFixtureMarker(object):
assert values == [1, 1, 2, 2]
def test_module_parametrized_ordering(self, testdir):
testdir.makeini("""
[pytest]
console_output_style=classic
""")
testdir.makeconftest("""
import pytest
@@ -2165,6 +2169,10 @@ class TestFixtureMarker(object):
""")
def test_class_ordering(self, testdir):
testdir.makeini("""
[pytest]
console_output_style=classic
""")
testdir.makeconftest("""
import pytest

View File

@@ -960,6 +960,10 @@ class TestMetafuncFunctional(object):
])
def test_parametrize_with_ids(self, testdir):
testdir.makeini("""
[pytest]
console_output_style=classic
""")
testdir.makepyfile("""
import pytest
def pytest_generate_tests(metafunc):
@@ -1005,9 +1009,9 @@ class TestMetafuncFunctional(object):
result = testdir.runpytest("-v")
assert result.ret == 1
result.stdout.fnmatch_lines_random([
"*test_function*basic*PASSED",
"*test_function*1-1*PASSED",
"*test_function*advanced*FAILED",
"*test_function*basic*PASSED*",
"*test_function*1-1*PASSED*",
"*test_function*advanced*FAILED*",
])
def test_fixture_parametrized_empty_ids(self, testdir):
@@ -1062,8 +1066,8 @@ class TestMetafuncFunctional(object):
result = testdir.runpytest("-v")
assert result.ret == 1
result.stdout.fnmatch_lines_random([
"*test_function*a0*PASSED",
"*test_function*a1*FAILED"
"*test_function*a0*PASSED*",
"*test_function*a1*FAILED*"
])
@pytest.mark.parametrize(("scope", "length"),

View File

@@ -238,6 +238,6 @@ def test_show_fixtures_and_execute_test(testdir):
result.stdout.fnmatch_lines([
'*SETUP F arg*',
'*test_arg (fixtures used: arg)F',
'*test_arg (fixtures used: arg)F*',
'*TEARDOWN F arg*',
])