Skip to content

Commit 91584ed

Browse files
committed
Do not use default name pattern for test classes
Names like TestVisitor should not be interpreted as a class containing test methods (we use pytest_describe instead). Avoid such names in our test suite anyway.
1 parent 1b0ab87 commit 91584ed

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ ignore =
1313
# To actually run the benchmarks, use --benchmark-enable on the command line.
1414
# To run the slow tests (fuzzing), add --run-slow on the command line.
1515
addopts = --benchmark-disable
16+
# Deactivate default name pattern for test classes (we use pytest_describe).
17+
python_classes = PyTest*
18+
# Set a timeout in seconds for aborting tests that run too long.
1619
timeout = 100

tests/benchmarks/test_visit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from ..fixtures import big_schema_sdl # noqa: F401
55

66

7-
class TestVisitor(Visitor):
7+
class DummyVisitor(Visitor):
88
@staticmethod
99
def enter(*args):
1010
pass
@@ -16,12 +16,12 @@ def leave(*args):
1616

1717
def test_visit_all_ast_nodes(benchmark, big_schema_sdl): # noqa: F811
1818
document_ast = parse(big_schema_sdl)
19-
visitor = TestVisitor()
19+
visitor = DummyVisitor()
2020
benchmark(lambda: visit(document_ast, visitor))
2121

2222

2323
def test_visit_all_ast_nodes_in_parallel(benchmark, big_schema_sdl): # noqa: F811
2424
document_ast = parse(big_schema_sdl)
25-
visitor = TestVisitor()
25+
visitor = DummyVisitor()
2626
parallel_visitor = ParallelVisitor([visitor] * 50)
2727
benchmark(lambda: visit(document_ast, parallel_visitor))

0 commit comments

Comments
 (0)