Test support for multiple --doctest-glob arguments (#1255).
(self, pytester: Pytester)
| 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", |
nothing calls this directly
no test coverage detected