Skip to content

Commit d7176e2

Browse files
committed
Move collection options to correct section
Moves --continue-on-collection-errors to "collection:"
1 parent 60173b5 commit d7176e2

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/_pytest/main.py

+36-36
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,6 @@
5454

5555

5656
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-
)
8657
group = parser.getgroup("general", "Running and selection options")
8758
group._addoption(
8859
"-x",
@@ -127,13 +98,6 @@ def pytest_addoption(parser: Parser) -> None:
12798
help="Load configuration from `FILE` instead of trying to locate one of the "
12899
"implicit configuration files.",
129100
)
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-
)
137101
group._addoption(
138102
"--rootdir",
139103
action="store",
@@ -219,6 +183,13 @@ def pytest_addoption(parser: Parser) -> None:
219183
default=False,
220184
help="Don't ignore tests in a local virtualenv directory",
221185
)
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+
)
222193
group.addoption(
223194
"--import-mode",
224195
default="prepend",
@@ -227,6 +198,35 @@ def pytest_addoption(parser: Parser) -> None:
227198
help="Prepend/append to sys.path when importing test modules and conftest "
228199
"files. Default: prepend.",
229200
)
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+
)
230230
parser.addini(
231231
"consider_namespace_packages",
232232
type="bool",

0 commit comments

Comments
 (0)