def test_tabs(): path = sample_path('doctest_tabs.txt') parser = DocTestParser(optionflags=REPORT_NDIFF|ELLIPSIS) with pytest.raises(ValueError) as excinfo: Document.parse(path, parser) assert str(excinfo.value) == ( 'tabs are not supported, first one found at line 2, column 4' )
def test_directive_indent_equal_to_block(): document = document_from_sample('capture_bad_indent2.txt') with pytest.raises(ValueError) as excinfo: list(parse_captures(document)) assert str(excinfo.value) == ( "couldn't find the start of the block to match' .. -> foo' " "on line 5 of "+sample_path('capture_bad_indent2.txt') )
def test_directive_indent_beyond_block(): document = document_from_sample('capture_bad_indent1.txt') with pytest.raises(ValueError) as excinfo: list(parse_captures(document)) if PY3: block = "' .. -> foo'" else: block = "u' .. -> foo'" assert str( excinfo.value) == ("couldn't find the start of the block to match " + block + " " "on line 5 of " + sample_path('capture_bad_indent1.txt'))
def test_tabs(): path = sample_path('doctest_tabs.txt') parser = DocTestParser() with pytest.raises(ValueError): Document.parse(path, parser)