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

Method test_multiple_patterns

testing/test_doctest.py:126–153  ·  view source on GitHub ↗

Test support for multiple --doctest-glob arguments (#1255).

(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

124 reprec.assertoutcome(failed=1)
125
126 def test_multiple_patterns(self, pytester: Pytester):
127 """Test support for multiple --doctest-glob arguments (#1255)."""
128 pytester.maketxtfile(
129 xdoc="""
130 >>> 1
131 1
132 """
133 )
134 pytester.makefile(
135 ".foo",
136 test="""
137 >>> 1
138 1
139 """,
140 )
141 pytester.maketxtfile(
142 test_normal="""
143 >>> 1
144 1
145 """
146 )
147 expected = {"xdoc.txt", "test.foo", "test_normal.txt"}
148 assert {x.name for x in pytester.path.iterdir()} == expected
149 args = ["--doctest-glob=xdoc*.txt", "--doctest-glob=*.foo"]
150 result = pytester.runpytest(*args)
151 result.stdout.fnmatch_lines(["*test.foo *", "*xdoc.txt *", "*2 passed*"])
152 result = pytester.runpytest()
153 result.stdout.fnmatch_lines(["*test_normal.txt *", "*1 passed*"])
154
155 @pytest.mark.parametrize(
156 " test_string, encoding",

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
maketxtfileMethod · 0.45
makefileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected