Add a doctest for module docstrings
This commit is contained in:
		
							parent
							
								
									61caa4f776
								
							
						
					
					
						commit
						787b0212d1
					
				|  | @ -323,3 +323,29 @@ class TestDoctests: | ||||||
|         """) |         """) | ||||||
|         reprec = testdir.inline_run(p, "--doctest-modules") |         reprec = testdir.inline_run(p, "--doctest-modules") | ||||||
|         reprec.assertoutcome(failed=1, passed=0) |         reprec.assertoutcome(failed=1, passed=0) | ||||||
|  | 
 | ||||||
|  |     def test_ignored_whitespace_glob(self, testdir): | ||||||
|  |         testdir.makeini(""" | ||||||
|  |             [pytest] | ||||||
|  |             doctest_optionflags = ELLIPSIS NORMALIZE_WHITESPACE | ||||||
|  |         """) | ||||||
|  |         p = testdir.maketxtfile(xdoc=""" | ||||||
|  |             >>> a = "foo    " | ||||||
|  |             >>> print(a) | ||||||
|  |             foo | ||||||
|  |         """) | ||||||
|  |         reprec = testdir.inline_run(p, "--doctest-glob=x*.txt") | ||||||
|  |         reprec.assertoutcome(passed=1) | ||||||
|  | 
 | ||||||
|  |     def test_non_ignored_whitespace_glob(self, testdir): | ||||||
|  |         testdir.makeini(""" | ||||||
|  |             [pytest] | ||||||
|  |             doctest_optionflags = ELLIPSIS | ||||||
|  |         """) | ||||||
|  |         p = testdir.maketxtfile(xdoc=""" | ||||||
|  |             >>> a = "foo    " | ||||||
|  |             >>> print(a) | ||||||
|  |             foo | ||||||
|  |         """) | ||||||
|  |         reprec = testdir.inline_run(p, "--doctest-glob=x*.txt") | ||||||
|  |         reprec.assertoutcome(failed=1, passed=0) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue