Skip to content

Commit e8218e8

Browse files
committed
Remove the 'issue' marker from test suite
It doesn't seem to add much value (why would one execute tests based on that marker?), plus using the docstring for that encourages one to write a more descriptive message about the test
1 parent 645b82b commit e8218e8

File tree

10 files changed

+40
-33
lines changed

10 files changed

+40
-33
lines changed

testing/python/fixtures.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,10 +1925,10 @@ def test_hello(arg1):
19251925
reprec = testdir.inline_run()
19261926
reprec.assertoutcome(passed=1)
19271927

1928-
@pytest.mark.issue(226)
19291928
@pytest.mark.parametrize("param1", ["", "params=[1]"], ids=["p00", "p01"])
19301929
@pytest.mark.parametrize("param2", ["", "params=[1]"], ids=["p10", "p11"])
19311930
def test_ordering_dependencies_torndown_first(self, testdir, param1, param2):
1931+
"""#226"""
19321932
testdir.makepyfile(
19331933
"""
19341934
import pytest
@@ -2707,9 +2707,9 @@ def test_3():
27072707
reprec = testdir.inline_run("-v")
27082708
reprec.assertoutcome(passed=5)
27092709

2710-
@pytest.mark.issue(246)
27112710
@pytest.mark.parametrize("scope", ["session", "function", "module"])
27122711
def test_finalizer_order_on_parametrization(self, scope, testdir):
2712+
"""#246"""
27132713
testdir.makepyfile(
27142714
"""
27152715
import pytest
@@ -2744,8 +2744,8 @@ def test_other():
27442744
reprec = testdir.inline_run("-lvs")
27452745
reprec.assertoutcome(passed=3)
27462746

2747-
@pytest.mark.issue(396)
27482747
def test_class_scope_parametrization_ordering(self, testdir):
2748+
"""#396"""
27492749
testdir.makepyfile(
27502750
"""
27512751
import pytest
@@ -2865,8 +2865,8 @@ def test_foo(fix):
28652865
res = testdir.runpytest("-v")
28662866
res.stdout.fnmatch_lines(["*test_foo*alpha*", "*test_foo*beta*"])
28672867

2868-
@pytest.mark.issue(920)
28692868
def test_deterministic_fixture_collection(self, testdir, monkeypatch):
2869+
"""#920"""
28702870
testdir.makepyfile(
28712871
"""
28722872
import pytest
@@ -3635,7 +3635,6 @@ class TestScopeOrdering(object):
36353635
"""Class of tests that ensure fixtures are ordered based on their scopes (#2405)"""
36363636

36373637
@pytest.mark.parametrize("variant", ["mark", "autouse"])
3638-
@pytest.mark.issue(github="#2405")
36393638
def test_func_closure_module_auto(self, testdir, variant, monkeypatch):
36403639
"""Semantically identical to the example posted in #2405 when ``use_mark=True``"""
36413640
monkeypatch.setenv("FIXTURE_ACTIVATION_VARIANT", variant)

testing/python/integration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,9 @@ def test_blah(self):
393393
assert not call.items
394394

395395

396-
@pytest.mark.issue(351)
397396
class TestParameterize(object):
397+
"""#351"""
398+
398399
def test_idfn_marker(self, testdir):
399400
testdir.makepyfile(
400401
"""

testing/python/metafunc.py

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ def func(x, y):
159159
("x", "y"), [("abc", "def"), ("ghi", "jkl")], ids=["one"]
160160
)
161161

162-
@pytest.mark.issue(510)
163162
def test_parametrize_empty_list(self):
163+
"""#510"""
164+
164165
def func(y):
165166
pass
166167

@@ -262,8 +263,8 @@ def test_function():
262263
for val, expected in values:
263264
assert _idval(val, "a", 6, None, item=None, config=None) == expected
264265

265-
@pytest.mark.issue(250)
266266
def test_idmaker_autoname(self):
267+
"""#250"""
267268
from _pytest.python import idmaker
268269

269270
result = idmaker(
@@ -356,8 +357,8 @@ def test_idmaker_enum(self):
356357
result = idmaker(("a", "b"), [pytest.param(e.one, e.two)])
357358
assert result == ["Foo.one-Foo.two"]
358359

359-
@pytest.mark.issue(351)
360360
def test_idmaker_idfn(self):
361+
"""#351"""
361362
from _pytest.python import idmaker
362363

363364
def ids(val):
@@ -375,8 +376,8 @@ def ids(val):
375376
)
376377
assert result == ["10.0-IndexError()", "20-KeyError()", "three-b2"]
377378

378-
@pytest.mark.issue(351)
379379
def test_idmaker_idfn_unique_names(self):
380+
"""#351"""
380381
from _pytest.python import idmaker
381382

382383
def ids(val):
@@ -459,8 +460,9 @@ def test_idmaker_with_ids_unique_names(self):
459460
)
460461
assert result == ["a0", "a1", "b0", "c", "b1"]
461462

462-
@pytest.mark.issue(714)
463463
def test_parametrize_indirect(self):
464+
"""#714"""
465+
464466
def func(x, y):
465467
pass
466468

@@ -473,8 +475,9 @@ def func(x, y):
473475
assert metafunc._calls[0].params == dict(x=1, y=2)
474476
assert metafunc._calls[1].params == dict(x=1, y=3)
475477

476-
@pytest.mark.issue(714)
477478
def test_parametrize_indirect_list(self):
479+
"""#714"""
480+
478481
def func(x, y):
479482
pass
480483

@@ -483,8 +486,9 @@ def func(x, y):
483486
assert metafunc._calls[0].funcargs == dict(y="b")
484487
assert metafunc._calls[0].params == dict(x="a")
485488

486-
@pytest.mark.issue(714)
487489
def test_parametrize_indirect_list_all(self):
490+
"""#714"""
491+
488492
def func(x, y):
489493
pass
490494

@@ -493,8 +497,9 @@ def func(x, y):
493497
assert metafunc._calls[0].funcargs == {}
494498
assert metafunc._calls[0].params == dict(x="a", y="b")
495499

496-
@pytest.mark.issue(714)
497500
def test_parametrize_indirect_list_empty(self):
501+
"""#714"""
502+
498503
def func(x, y):
499504
pass
500505

@@ -503,9 +508,9 @@ def func(x, y):
503508
assert metafunc._calls[0].funcargs == dict(x="a", y="b")
504509
assert metafunc._calls[0].params == {}
505510

506-
@pytest.mark.issue(714)
507511
def test_parametrize_indirect_list_functional(self, testdir):
508512
"""
513+
#714
509514
Test parametrization with 'indirect' parameter applied on
510515
particular arguments. As y is is direct, its value should
511516
be used directly rather than being passed to the fixture
@@ -532,21 +537,23 @@ def test_simple(x,y):
532537
result = testdir.runpytest("-v")
533538
result.stdout.fnmatch_lines(["*test_simple*a-b*", "*1 passed*"])
534539

535-
@pytest.mark.issue(714)
536540
def test_parametrize_indirect_list_error(self, testdir):
541+
"""#714"""
542+
537543
def func(x, y):
538544
pass
539545

540546
metafunc = self.Metafunc(func)
541547
with pytest.raises(pytest.fail.Exception):
542548
metafunc.parametrize("x, y", [("a", "b")], indirect=["x", "z"])
543549

544-
@pytest.mark.issue(714)
545550
def test_parametrize_uses_no_fixture_error_indirect_false(self, testdir):
546551
"""The 'uses no fixture' error tells the user at collection time
547552
that the parametrize data they've set up doesn't correspond to the
548553
fixtures in their test function, rather than silently ignoring this
549554
and letting the test potentially pass.
555+
556+
#714
550557
"""
551558
testdir.makepyfile(
552559
"""
@@ -560,8 +567,8 @@ def test_simple(x):
560567
result = testdir.runpytest("--collect-only")
561568
result.stdout.fnmatch_lines(["*uses no argument 'y'*"])
562569

563-
@pytest.mark.issue(714)
564570
def test_parametrize_uses_no_fixture_error_indirect_true(self, testdir):
571+
"""#714"""
565572
testdir.makepyfile(
566573
"""
567574
import pytest
@@ -580,8 +587,8 @@ def test_simple(x):
580587
result = testdir.runpytest("--collect-only")
581588
result.stdout.fnmatch_lines(["*uses no fixture 'y'*"])
582589

583-
@pytest.mark.issue(714)
584590
def test_parametrize_indirect_uses_no_fixture_error_indirect_string(self, testdir):
591+
"""#714"""
585592
testdir.makepyfile(
586593
"""
587594
import pytest
@@ -597,8 +604,8 @@ def test_simple(x):
597604
result = testdir.runpytest("--collect-only")
598605
result.stdout.fnmatch_lines(["*uses no fixture 'y'*"])
599606

600-
@pytest.mark.issue(714)
601607
def test_parametrize_indirect_uses_no_fixture_error_indirect_list(self, testdir):
608+
"""#714"""
602609
testdir.makepyfile(
603610
"""
604611
import pytest
@@ -614,8 +621,8 @@ def test_simple(x):
614621
result = testdir.runpytest("--collect-only")
615622
result.stdout.fnmatch_lines(["*uses no fixture 'y'*"])
616623

617-
@pytest.mark.issue(714)
618624
def test_parametrize_argument_not_in_indirect_list(self, testdir):
625+
"""#714"""
619626
testdir.makepyfile(
620627
"""
621628
import pytest
@@ -1201,9 +1208,9 @@ def test_foo(x):
12011208
reprec = testdir.runpytest()
12021209
reprec.assert_outcomes(passed=4)
12031210

1204-
@pytest.mark.issue(463)
12051211
@pytest.mark.parametrize("attr", ["parametrise", "parameterize", "parameterise"])
12061212
def test_parametrize_misspelling(self, testdir, attr):
1213+
"""#463"""
12071214
testdir.makepyfile(
12081215
"""
12091216
import pytest
@@ -1386,8 +1393,9 @@ def pytest_generate_tests(metafunc):
13861393
assert output.count("preparing foo-3") == 1
13871394

13881395

1389-
@pytest.mark.issue(308)
13901396
class TestMarkersWithParametrization(object):
1397+
"""#308"""
1398+
13911399
def test_simple_mark(self, testdir):
13921400
s = """
13931401
import pytest
@@ -1575,8 +1583,8 @@ def test_increment(n, expected):
15751583
reprec = testdir.inline_run(SHOW_PYTEST_WARNINGS_ARG)
15761584
reprec.assertoutcome(passed=2, skipped=2)
15771585

1578-
@pytest.mark.issue(290)
15791586
def test_parametrize_ID_generation_string_int_works(self, testdir):
1587+
"""#290"""
15801588
testdir.makepyfile(
15811589
"""
15821590
import pytest

testing/test_capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ def test_hello(capfd):
605605
result.stdout.fnmatch_lines(["*KeyboardInterrupt*"])
606606
assert result.ret == 2
607607

608-
@pytest.mark.issue(14)
609608
def test_capture_and_logging(self, testdir):
609+
"""#14"""
610610
p = testdir.makepyfile(
611611
"""\
612612
import logging

testing/test_conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,10 @@ def test_no_conftest(fxtr):
491491
("snc", ".", 1),
492492
],
493493
)
494-
@pytest.mark.issue(616)
495494
def test_parsefactories_relative_node_ids(
496495
self, testdir, chdir, testarg, expect_ntests_passed
497496
):
497+
"""#616"""
498498
dirs = self._setup_tree(testdir)
499499
print("pytest run in cwd: %s" % (dirs[chdir].relto(testdir.tmpdir)))
500500
print("pytestarg : %s" % (testarg))

testing/test_mark.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,8 @@ def test_bar(self): pass
452452
items, rec = testdir.inline_genitems(p)
453453
self.assert_markers(items, test_foo=("a", "b"), test_bar=("a",))
454454

455-
@pytest.mark.issue(568)
456455
def test_mark_should_not_pass_to_siebling_class(self, testdir):
456+
"""#568"""
457457
p = testdir.makepyfile(
458458
"""
459459
import pytest
@@ -655,9 +655,9 @@ def assert_markers(self, items, **expected):
655655
markers = {m.name for m in items[name].iter_markers()}
656656
assert markers == set(expected_markers)
657657

658-
@pytest.mark.issue(1540)
659658
@pytest.mark.filterwarnings("ignore")
660659
def test_mark_from_parameters(self, testdir):
660+
"""#1540"""
661661
testdir.makepyfile(
662662
"""
663663
import pytest
@@ -943,9 +943,9 @@ def test_addmarker_order():
943943
assert extracted == ["c", "a", "b"]
944944

945945

946-
@pytest.mark.issue("https://github.com/pytest-dev/pytest/issues/3605")
947946
@pytest.mark.filterwarnings("ignore")
948947
def test_markers_from_parametrize(testdir):
948+
"""#3605"""
949949
testdir.makepyfile(
950950
"""
951951
from __future__ import print_function

testing/test_recwarn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def test_recording(self):
4747
assert values is rec.list
4848
pytest.raises(AssertionError, rec.pop)
4949

50-
@pytest.mark.issue(4243)
5150
def test_warn_stacklevel(self):
51+
"""#4243"""
5252
rec = WarningsRecorder()
5353
with rec:
5454
warnings.warn("test", DeprecationWarning, 2)

testing/test_tmpdir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def test_mktemp(self, tmp_path):
5858
assert tmp2.relto(t.getbasetemp()).startswith("this")
5959
assert tmp2 != tmp
6060

61-
@pytest.mark.issue(4425)
6261
def test_tmppath_relative_basetemp_absolute(self, tmp_path, monkeypatch):
62+
"""#4425"""
6363
from _pytest.tmpdir import TempPathFactory
6464

6565
monkeypatch.chdir(tmp_path)

testing/test_unittest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,11 +930,11 @@ def test_should_not_run(self):
930930
reprec.assertoutcome(passed=1)
931931

932932

933-
@pytest.mark.issue(3498)
934933
@pytest.mark.parametrize(
935934
"base", ["six.moves.builtins.object", "unittest.TestCase", "unittest2.TestCase"]
936935
)
937936
def test_usefixtures_marker_on_unittest(base, testdir):
937+
"""#3498"""
938938
module = base.rsplit(".", 1)[0]
939939
pytest.importorskip(module)
940940
testdir.makepyfile(

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ filterwarnings =
172172
ignore::_pytest.warning_types.UnknownMarkWarning
173173
pytester_example_dir = testing/example_scripts
174174
markers =
175-
issue
176175
slow
177176

178177
[flake8]

0 commit comments

Comments
 (0)