54
54
55
55
56
56
def pytest_addoption (parser : Parser ) -> None :
57
- parser .addini (
58
- "norecursedirs" ,
59
- "Directory patterns to avoid for recursion" ,
60
- type = "args" ,
61
- default = [
62
- "*.egg" ,
63
- ".*" ,
64
- "_darcs" ,
65
- "build" ,
66
- "CVS" ,
67
- "dist" ,
68
- "node_modules" ,
69
- "venv" ,
70
- "{arch}" ,
71
- ],
72
- )
73
- parser .addini (
74
- "testpaths" ,
75
- "Directories to search for tests when no files or directories are given on the "
76
- "command line" ,
77
- type = "args" ,
78
- default = [],
79
- )
80
- parser .addini (
81
- "collect_imported_tests" ,
82
- "Whether to collect tests in imported modules outside `testpaths`" ,
83
- type = "bool" ,
84
- default = True ,
85
- )
86
57
group = parser .getgroup ("general" , "Running and selection options" )
87
58
group ._addoption (
88
59
"-x" ,
@@ -127,13 +98,6 @@ def pytest_addoption(parser: Parser) -> None:
127
98
help = "Load configuration from `FILE` instead of trying to locate one of the "
128
99
"implicit configuration files." ,
129
100
)
130
- group ._addoption (
131
- "--continue-on-collection-errors" ,
132
- action = "store_true" ,
133
- default = False ,
134
- dest = "continue_on_collection_errors" ,
135
- help = "Force test execution even if collection errors occur" ,
136
- )
137
101
group ._addoption (
138
102
"--rootdir" ,
139
103
action = "store" ,
@@ -219,6 +183,13 @@ def pytest_addoption(parser: Parser) -> None:
219
183
default = False ,
220
184
help = "Don't ignore tests in a local virtualenv directory" ,
221
185
)
186
+ group ._addoption (
187
+ "--continue-on-collection-errors" ,
188
+ action = "store_true" ,
189
+ default = False ,
190
+ dest = "continue_on_collection_errors" ,
191
+ help = "Force test execution even if collection errors occur" ,
192
+ )
222
193
group .addoption (
223
194
"--import-mode" ,
224
195
default = "prepend" ,
@@ -227,6 +198,35 @@ def pytest_addoption(parser: Parser) -> None:
227
198
help = "Prepend/append to sys.path when importing test modules and conftest "
228
199
"files. Default: prepend." ,
229
200
)
201
+ parser .addini (
202
+ "norecursedirs" ,
203
+ "Directory patterns to avoid for recursion" ,
204
+ type = "args" ,
205
+ default = [
206
+ "*.egg" ,
207
+ ".*" ,
208
+ "_darcs" ,
209
+ "build" ,
210
+ "CVS" ,
211
+ "dist" ,
212
+ "node_modules" ,
213
+ "venv" ,
214
+ "{arch}" ,
215
+ ],
216
+ )
217
+ parser .addini (
218
+ "testpaths" ,
219
+ "Directories to search for tests when no files or directories are given on the "
220
+ "command line" ,
221
+ type = "args" ,
222
+ default = [],
223
+ )
224
+ parser .addini (
225
+ "collect_imported_tests" ,
226
+ "Whether to collect tests in imported modules outside `testpaths`" ,
227
+ type = "bool" ,
228
+ default = True ,
229
+ )
230
230
parser .addini (
231
231
"consider_namespace_packages" ,
232
232
type = "bool" ,
0 commit comments