MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_doctest_items

Function test_doctest_items

testing/python/show_fixtures_per_test.py:161–182  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

159
160
161def test_doctest_items(pytester: Pytester) -> None:
162 pytester.makepyfile(
163 '''
164 def foo():
165 """
166 >>> 1 + 1
167 2
168 """
169 '''
170 )
171 pytester.maketxtfile(
172 """
173 >>> 1 + 1
174 2
175 """
176 )
177 result = pytester.runpytest(
178 "--fixtures-per-test", "--doctest-modules", "--doctest-glob=*.txt", "-v"
179 )
180 assert result.ret == 0
181
182 result.stdout.fnmatch_lines(["*collected 2 items*"])
183
184
185def test_multiline_docstring_in_module(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
maketxtfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected