Skip to content

Commit bd55130

Browse files
committed
Speed up pytest collection by ignoring certain folders
1 parent ab5c412 commit bd55130

File tree

6 files changed

+65
-12
lines changed

6 files changed

+65
-12
lines changed

examples/master_qa/pytest.ini

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider:
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, don't collect recordings:
4+
addopts = --capture=no -p no:cacheprovider --ignore=recordings
5+
6+
# Skip looking in these directories for tests:
7+
norecursedirs = .* build dist recordings temp
58

69
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
710
filterwarnings =
@@ -18,7 +21,8 @@ python_files = test_*.py *_test.py *_tests.py *_suite.py *_test_*.py
1821
python_classes = Test* *Test* *Test *Tests *Suite
1922
python_functions = test_*
2023

21-
# Here are the pytest markers used in the example tests:
24+
# Here are some common pytest markers:
25+
# (Some are used in the example tests.)
2226
# (pytest v4.5.0 and newer requires marker registration to prevent warnings.)
2327
# (Future versions of pytest may turn those marker warnings into errors.)
2428
markers =
@@ -32,7 +36,11 @@ markers =
3236
offline: custom marker
3337
develop: custom marker
3438
qa: custom marker
39+
ci: custom marker
40+
e2e: custom marker
3541
ready: custom marker
42+
smoke: custom marker
43+
deploy: custom marker
3644
active: custom marker
3745
master: custom marker
3846
release: custom marker
Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider:
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, don't collect recordings:
4+
addopts = --capture=no -p no:cacheprovider --ignore=recordings
5+
6+
# Skip looking in these directories for tests:
7+
norecursedirs = .* build dist recordings temp
58

69
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
710
filterwarnings =
811
ignore::pytest.PytestWarning
912
ignore:.*U.*mode is deprecated:DeprecationWarning
1013

14+
# Configure the junit_family option explicitly:
15+
junit_family = legacy
16+
1117
# Set pytest discovery rules:
1218
# (Most of the rules here are similar to the default rules.)
1319
# (unittest.TestCase rules override the rules here for classes and functions.)
1420
python_files = *.py
21+
python_classes = Test* *Test* *Test *Tests *Suite
1522
python_functions = test_*
23+
24+
# Here are some common pytest markers:
25+
# (Some are used in the example tests.)
26+
# (pytest v4.5.0 and newer requires marker registration to prevent warnings.)
27+
# (Future versions of pytest may turn those marker warnings into errors.)
28+
markers =
29+
marker1: custom marker
30+
marker2: custom marker
31+
marker3: custom marker
32+
marker_test_suite: custom marker
33+
expected_failure: custom marker
34+
local: custom marker
35+
remote: custom marker
36+
offline: custom marker
37+
develop: custom marker
38+
qa: custom marker
39+
ci: custom marker
40+
e2e: custom marker
41+
ready: custom marker
42+
smoke: custom marker
43+
deploy: custom marker
44+
active: custom marker
45+
master: custom marker
46+
release: custom marker
47+
staging: custom marker
48+
production: custom marker

examples/pytest.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider:
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, don't collect recordings:
4+
addopts = --capture=no -p no:cacheprovider --ignore=recordings
5+
6+
# Skip looking in these directories for tests:
7+
norecursedirs = .* build dist recordings temp
58

69
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
710
filterwarnings =

examples/translations/pytest.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider:
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, don't collect recordings:
4+
addopts = --capture=no -p no:cacheprovider --ignore=recordings
5+
6+
# Skip looking in these directories for tests:
7+
norecursedirs = .* build dist recordings temp
58

69
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
710
filterwarnings =

pytest.ini

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[pytest]
22

3-
# Display console output, disable cacheprovider:
4-
addopts = --capture=no -p no:cacheprovider
3+
# Display console output, disable cacheprovider, don't collect recordings:
4+
addopts = --capture=no -p no:cacheprovider --ignore=recordings
5+
6+
# Skip looking in these directories for tests:
7+
norecursedirs = .* build dist recordings temp
58

69
# Ignore warnings such as DeprecationWarning and PytestUnknownMarkWarning
710
filterwarnings =

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ def main():
121121

122122
data = []
123123
data.append("[pytest]")
124-
data.append("addopts = --capture=no -p no:cacheprovider")
124+
data.append(
125+
"addopts = --capture=no -p no:cacheprovider --ignore=recordings"
126+
)
127+
data.append("norecursedirs = .* build dist recordings temp")
125128
data.append("filterwarnings =")
126129
data.append(" ignore::pytest.PytestWarning")
127130
data.append(" ignore:.*U.*mode is deprecated:DeprecationWarning")

0 commit comments

Comments
 (0)