Skip to content

Commit dae07aa

Browse files
committed
Update pytest discovery rules
1 parent ad31f39 commit dae07aa

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

pytest.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ addopts = --capture=no --ignore conftest.py -p no:cacheprovider
66
# Ignore warnings such as DeprecationWarning and pytest.PytestUnknownMarkWarning
77
filterwarnings = ignore::pytest.PytestWarning
88

9+
# Set pytest discovery rules:
10+
# (Most of the rules here are similar to the default rules.)
11+
# (unittest.TestCase rules override the rules here for classes and functions.)
12+
python_files = test_*.py *_test.py *_tests.py *_suite.py
13+
python_classes = Test* *Test* *Test *Tests *Suite
14+
python_functions = test_*
15+
916
# Here are the pytest markers used in the example tests:
1017
# (pytest v4.5.0 and newer requires marker registration to prevent warnings.)
1118
# (Future versions of pytest may turn those marker warnings into errors.)

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ def main():
5555
data.append("addopts = --capture=no --ignore conftest.py "
5656
"-p no:cacheprovider")
5757
data.append("filterwarnings = ignore::pytest.PytestWarning")
58+
data.append("python_files = test_*.py *_test.py *_tests.py *_suite.py")
59+
data.append("python_classes = Test* *Test* *Test *Tests *Suite")
60+
data.append("python_functions = test_*")
61+
data.append("markers =")
62+
data.append(" marker1: custom marker")
63+
data.append(" marker2: custom marker")
64+
data.append(" marker3: custom marker")
65+
data.append(" marker_test_suite: custom marker")
66+
data.append(" expected_failure: custom marker")
67+
data.append("")
5868
file_path = "%s/%s" % (dir_name, "pytest.ini")
5969
file = codecs.open(file_path, "w+", "utf-8")
6070
file.writelines("\r\n".join(data))

0 commit comments

Comments
 (0)