Skip to content

Commit

Permalink
Register standard issue mark for selftests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Mar 16, 2019
1 parent 57b32ea commit 1564a8e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 26 deletions.
8 changes: 4 additions & 4 deletions testing/python/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@ def test_hello(arg1):
reprec = testdir.inline_run()
reprec.assertoutcome(passed=1)

@pytest.mark.issue226
@pytest.mark.issue(226)
@pytest.mark.parametrize("param1", ["", "params=[1]"], ids=["p00", "p01"])
@pytest.mark.parametrize("param2", ["", "params=[1]"], ids=["p10", "p11"])
def test_ordering_dependencies_torndown_first(self, testdir, param1, param2):
Expand Down Expand Up @@ -2708,7 +2708,7 @@ def test_3():
reprec = testdir.inline_run("-v")
reprec.assertoutcome(passed=5)

@pytest.mark.issue246
@pytest.mark.issue(246)
@pytest.mark.parametrize("scope", ["session", "function", "module"])
def test_finalizer_order_on_parametrization(self, scope, testdir):
testdir.makepyfile(
Expand Down Expand Up @@ -2745,7 +2745,7 @@ def test_other():
reprec = testdir.inline_run("-lvs")
reprec.assertoutcome(passed=3)

@pytest.mark.issue396
@pytest.mark.issue(396)
def test_class_scope_parametrization_ordering(self, testdir):
testdir.makepyfile(
"""
Expand Down Expand Up @@ -2866,7 +2866,7 @@ def test_foo(fix):
res = testdir.runpytest("-v")
res.stdout.fnmatch_lines(["*test_foo*alpha*", "*test_foo*beta*"])

@pytest.mark.issue920
@pytest.mark.issue(920)
def test_deterministic_fixture_collection(self, testdir, monkeypatch):
testdir.makepyfile(
"""
Expand Down
2 changes: 1 addition & 1 deletion testing/python/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def test_blah(self):
assert not call.items


@pytest.mark.issue351
@pytest.mark.issue(351)
class TestParameterize(object):
def test_idfn_marker(self, testdir):
testdir.makepyfile(
Expand Down
36 changes: 18 additions & 18 deletions testing/python/metafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def func(x, y):
("x", "y"), [("abc", "def"), ("ghi", "jkl")], ids=["one"]
)

@pytest.mark.issue510
@pytest.mark.issue(510)
def test_parametrize_empty_list(self):
def func(y):
pass
Expand Down Expand Up @@ -262,7 +262,7 @@ def test_function():
for val, expected in values:
assert _idval(val, "a", 6, None, item=None, config=None) == expected

@pytest.mark.issue250
@pytest.mark.issue(250)
def test_idmaker_autoname(self):
from _pytest.python import idmaker

Expand Down Expand Up @@ -356,7 +356,7 @@ def test_idmaker_enum(self):
result = idmaker(("a", "b"), [pytest.param(e.one, e.two)])
assert result == ["Foo.one-Foo.two"]

@pytest.mark.issue351
@pytest.mark.issue(351)
def test_idmaker_idfn(self):
from _pytest.python import idmaker

Expand All @@ -375,7 +375,7 @@ def ids(val):
)
assert result == ["10.0-IndexError()", "20-KeyError()", "three-b2"]

@pytest.mark.issue351
@pytest.mark.issue(351)
def test_idmaker_idfn_unique_names(self):
from _pytest.python import idmaker

Expand Down Expand Up @@ -459,7 +459,7 @@ def test_idmaker_with_ids_unique_names(self):
)
assert result == ["a0", "a1", "b0", "c", "b1"]

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect(self):
def func(x, y):
pass
Expand All @@ -473,7 +473,7 @@ def func(x, y):
assert metafunc._calls[0].params == dict(x=1, y=2)
assert metafunc._calls[1].params == dict(x=1, y=3)

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect_list(self):
def func(x, y):
pass
Expand All @@ -483,7 +483,7 @@ def func(x, y):
assert metafunc._calls[0].funcargs == dict(y="b")
assert metafunc._calls[0].params == dict(x="a")

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect_list_all(self):
def func(x, y):
pass
Expand All @@ -493,7 +493,7 @@ def func(x, y):
assert metafunc._calls[0].funcargs == {}
assert metafunc._calls[0].params == dict(x="a", y="b")

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect_list_empty(self):
def func(x, y):
pass
Expand All @@ -503,7 +503,7 @@ def func(x, y):
assert metafunc._calls[0].funcargs == dict(x="a", y="b")
assert metafunc._calls[0].params == {}

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect_list_functional(self, testdir):
"""
Test parametrization with 'indirect' parameter applied on
Expand Down Expand Up @@ -532,7 +532,7 @@ def test_simple(x,y):
result = testdir.runpytest("-v")
result.stdout.fnmatch_lines(["*test_simple*a-b*", "*1 passed*"])

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect_list_error(self, testdir):
def func(x, y):
pass
Expand All @@ -541,7 +541,7 @@ def func(x, y):
with pytest.raises(pytest.fail.Exception):
metafunc.parametrize("x, y", [("a", "b")], indirect=["x", "z"])

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_uses_no_fixture_error_indirect_false(self, testdir):
"""The 'uses no fixture' error tells the user at collection time
that the parametrize data they've set up doesn't correspond to the
Expand All @@ -560,7 +560,7 @@ def test_simple(x):
result = testdir.runpytest("--collect-only")
result.stdout.fnmatch_lines(["*uses no argument 'y'*"])

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_uses_no_fixture_error_indirect_true(self, testdir):
testdir.makepyfile(
"""
Expand All @@ -580,7 +580,7 @@ def test_simple(x):
result = testdir.runpytest("--collect-only")
result.stdout.fnmatch_lines(["*uses no fixture 'y'*"])

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect_uses_no_fixture_error_indirect_string(self, testdir):
testdir.makepyfile(
"""
Expand All @@ -597,7 +597,7 @@ def test_simple(x):
result = testdir.runpytest("--collect-only")
result.stdout.fnmatch_lines(["*uses no fixture 'y'*"])

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_indirect_uses_no_fixture_error_indirect_list(self, testdir):
testdir.makepyfile(
"""
Expand All @@ -614,7 +614,7 @@ def test_simple(x):
result = testdir.runpytest("--collect-only")
result.stdout.fnmatch_lines(["*uses no fixture 'y'*"])

@pytest.mark.issue714
@pytest.mark.issue(714)
def test_parametrize_argument_not_in_indirect_list(self, testdir):
testdir.makepyfile(
"""
Expand Down Expand Up @@ -1201,7 +1201,7 @@ def test_foo(x):
reprec = testdir.runpytest()
reprec.assert_outcomes(passed=4)

@pytest.mark.issue463
@pytest.mark.issue(463)
@pytest.mark.parametrize("attr", ["parametrise", "parameterize", "parameterise"])
def test_parametrize_misspelling(self, testdir, attr):
testdir.makepyfile(
Expand Down Expand Up @@ -1386,7 +1386,7 @@ def pytest_generate_tests(metafunc):
assert output.count("preparing foo-3") == 1


@pytest.mark.issue308
@pytest.mark.issue(308)
class TestMarkersWithParametrization(object):
def test_simple_mark(self, testdir):
s = """
Expand Down Expand Up @@ -1575,7 +1575,7 @@ def test_increment(n, expected):
reprec = testdir.inline_run(SHOW_PYTEST_WARNINGS_ARG)
reprec.assertoutcome(passed=2, skipped=2)

@pytest.mark.issue290
@pytest.mark.issue(290)
def test_parametrize_ID_generation_string_int_works(self, testdir):
testdir.makepyfile(
"""
Expand Down
2 changes: 1 addition & 1 deletion testing/test_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def test_hello(capfd):
result.stdout.fnmatch_lines(["*KeyboardInterrupt*"])
assert result.ret == 2

@pytest.mark.issue14
@pytest.mark.issue(14)
def test_capture_and_logging(self, testdir):
p = testdir.makepyfile(
"""\
Expand Down
2 changes: 1 addition & 1 deletion testing/test_conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def test_no_conftest(fxtr):
("snc", ".", 1),
],
)
@pytest.mark.issue616
@pytest.mark.issue(616)
def test_parsefactories_relative_node_ids(
self, testdir, chdir, testarg, expect_ntests_passed
):
Expand Down
2 changes: 1 addition & 1 deletion testing/test_mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def test_bar(self): pass
items, rec = testdir.inline_genitems(p)
self.assert_markers(items, test_foo=("a", "b"), test_bar=("a",))

@pytest.mark.issue568
@pytest.mark.issue(568)
def test_mark_should_not_pass_to_siebling_class(self, testdir):
p = testdir.makepyfile(
"""
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ filterwarnings =
# Do not cause SyntaxError for invalid escape sequences in py37.
default:invalid escape sequence:DeprecationWarning
pytester_example_dir = testing/example_scripts
markers =
issue

[flake8]
max-line-length = 120
Expand Down

0 comments on commit 1564a8e

Please sign in to comment.