@@ -90,20 +90,11 @@ Changing directory recursion
9090
9191You can set the :confval: `norecursedirs ` option in a configuration file:
9292
93- .. tab :: toml
93+ .. code-block :: toml
9494
95- .. code-block :: toml
96-
97- # content of pytest.toml
98- [pytest]
99- norecursedirs = [".svn", "_build", "tmp*"]
100-
101- .. tab :: ini
102-
103- .. code-block :: ini
104-
105- [pytest]
106- norecursedirs = .svn _build tmp*
95+ # content of pytest.toml
96+ [pytest]
97+ norecursedirs = [".svn", "_build", "tmp*"]
10798
10899 This would tell ``pytest `` to not recurse into typical subversion or sphinx-build directories or into any ``tmp `` prefixed directory.
109100
@@ -117,26 +108,14 @@ the :confval:`python_files`, :confval:`python_classes` and
117108:confval: `python_functions ` in your :ref: `configuration file <config file formats >`.
118109Here is an example:
119110
120- .. tab :: toml
121-
122- .. code-block :: toml
111+ .. code-block :: toml
123112
124- # content of pytest.toml
125- # Example 1: have pytest look for "check" instead of "test"
126- [pytest]
127- python_files = ["check_*.py"]
128- python_classes = ["Check"]
129- python_functions = ["*_check"]
130-
131- .. tab :: ini
132-
133- .. code-block :: ini
134-
135- # Example 1: have pytest look for "check" instead of "test"
136- [pytest]
137- python_files = check_*.py
138- python_classes = Check
139- python_functions = *_check
113+ # content of pytest.toml
114+ # Example 1: have pytest look for "check" instead of "test"
115+ [pytest]
116+ python_files = ["check_*.py"]
117+ python_classes = ["Check"]
118+ python_functions = ["*_check"]
140119
141120 This would make ``pytest `` look for tests in files that match the ``check_*
142121.py `` glob-pattern, ``Check `` prefixes in classes, and functions and methods
@@ -173,22 +152,12 @@ The test collection would look like this:
173152
174153 You can check for multiple glob patterns by adding a space between the patterns:
175154
176- .. tab :: toml
177-
178- .. code-block :: toml
179-
180- # content of pytest.toml
181- # Example 2: have pytest look for files with "test" and "example"
182- [pytest]
183- python_files = ["test_*.py", "example_*.py"]
155+ .. code-block :: toml
184156
185- .. tab :: ini
186-
187- .. code-block :: ini
188-
189- # Example 2: have pytest look for files with "test" and "example"
190- [pytest]
191- python_files = test_*.py example_*.py
157+ # content of pytest.toml
158+ # Example 2: have pytest look for files with "test" and "example"
159+ [pytest]
160+ python_files = ["test_*.py", "example_*.py"]
192161
193162 .. note ::
194163
@@ -212,20 +181,11 @@ which would run the respective test module. Like with
212181other options, through a configuration file and the :confval: `addopts ` option you
213182can make this change more permanently:
214183
215- .. tab :: toml
216-
217- .. code-block :: toml
218-
219- # content of pytest.toml
220- [pytest]
221- addopts = ["--pyargs"]
222-
223- .. tab :: ini
184+ .. code-block :: toml
224185
225- .. code-block :: ini
226-
227- [pytest]
228- addopts = --pyargs
186+ # content of pytest.toml
187+ [pytest]
188+ addopts = ["--pyargs"]
229189
230190 Now a simple invocation of ``pytest NAME `` will check
231191if NAME exists as an importable package/module and otherwise
@@ -264,20 +224,11 @@ Customizing test collection
264224
265225 You can easily instruct ``pytest `` to discover tests from every Python file:
266226
267- .. tab :: toml
268-
269- .. code-block :: toml
270-
271- # content of pytest.toml
272- [pytest]
273- python_files = ["*.py"]
274-
275- .. tab :: ini
276-
277- .. code-block :: ini
227+ .. code-block :: toml
278228
279- [pytest]
280- python_files = *.py
229+ # content of pytest.toml
230+ [pytest]
231+ python_files = ["*.py"]
281232
282233 However, many projects will have a ``setup.py `` which they don't want to be
283234imported. Moreover, there may files only importable by a specific python
0 commit comments