diff options
Diffstat (limited to 'tests/test_directive_code.py')
-rw-r--r-- | tests/test_directive_code.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_directive_code.py b/tests/test_directive_code.py index 5f67c5627..548a5d72c 100644 --- a/tests/test_directive_code.py +++ b/tests/test_directive_code.py @@ -10,6 +10,7 @@ """ import pytest +import os from sphinx.config import Config from sphinx.directives.code import LiteralIncludeReader @@ -29,6 +30,7 @@ def literal_inc_path(testroot): return testroot / 'literal.inc' +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader(literal_inc_path): options = {'lineno-match': True} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -38,6 +40,7 @@ def test_LiteralIncludeReader(literal_inc_path): assert reader.lineno_start == 1 +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_lineno_start(literal_inc_path): options = {'lineno-start': 5} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -47,6 +50,7 @@ def test_LiteralIncludeReader_lineno_start(literal_inc_path): assert reader.lineno_start == 5 +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_pyobject1(literal_inc_path): options = {'lineno-match': True, 'pyobject': 'Foo'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -56,6 +60,7 @@ def test_LiteralIncludeReader_pyobject1(literal_inc_path): assert reader.lineno_start == 6 +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_pyobject2(literal_inc_path): options = {'pyobject': 'Bar'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -66,6 +71,7 @@ def test_LiteralIncludeReader_pyobject2(literal_inc_path): assert reader.lineno_start == 1 # no lineno-match +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_pyobject3(literal_inc_path): options = {'pyobject': 'Bar.baz'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -74,6 +80,7 @@ def test_LiteralIncludeReader_pyobject3(literal_inc_path): " pass\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_pyobject_and_lines(literal_inc_path): options = {'pyobject': 'Bar', 'lines': '2-'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -82,6 +89,7 @@ def test_LiteralIncludeReader_pyobject_and_lines(literal_inc_path): " pass\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_lines1(literal_inc_path): options = {'lines': '1-4'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -92,6 +100,7 @@ def test_LiteralIncludeReader_lines1(literal_inc_path): u"foo = \"Including Unicode characters: üöä\"\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_lines2(literal_inc_path): options = {'lines': '1,4,6'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -101,6 +110,7 @@ def test_LiteralIncludeReader_lines2(literal_inc_path): u"class Foo:\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_lines_and_lineno_match1(literal_inc_path): options = {'lines': '4-6', 'lineno-match': True} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -127,6 +137,7 @@ def test_LiteralIncludeReader_lines_and_lineno_match3(literal_inc_path, app, sta content, lines = reader.read() +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_start_at(literal_inc_path): options = {'lineno-match': True, 'start-at': 'Foo', 'end-at': 'Bar'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -138,6 +149,7 @@ def test_LiteralIncludeReader_start_at(literal_inc_path): assert reader.lineno_start == 6 +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_start_after(literal_inc_path): options = {'lineno-match': True, 'start-after': 'Foo', 'end-before': 'Bar'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -147,6 +159,7 @@ def test_LiteralIncludeReader_start_after(literal_inc_path): assert reader.lineno_start == 7 +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_start_after_and_lines(literal_inc_path): options = {'lineno-match': True, 'lines': '6-', 'start-after': 'coding', 'end-before': 'comment'} @@ -160,6 +173,7 @@ def test_LiteralIncludeReader_start_after_and_lines(literal_inc_path): assert reader.lineno_start == 8 +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_start_at_and_lines(literal_inc_path): options = {'lines': '2, 3, 5', 'start-at': 'foo', 'end-before': '#'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -192,6 +206,7 @@ def test_LiteralIncludeReader_missing_start_and_end(literal_inc_path): content, lines = reader.read() +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_prepend(literal_inc_path): options = {'lines': '1', 'prepend': 'Hello', 'append': 'Sphinx'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) @@ -201,6 +216,7 @@ def test_LiteralIncludeReader_prepend(literal_inc_path): "Sphinx\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_dedent(literal_inc_path): # dedent: 2 options = {'lines': '10-12', 'dedent': 2} @@ -227,6 +243,7 @@ def test_LiteralIncludeReader_dedent(literal_inc_path): "\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_tabwidth(testroot): # tab-width: 4 options = {'tab-width': 4, 'pyobject': 'Qux'} @@ -245,6 +262,7 @@ def test_LiteralIncludeReader_tabwidth(testroot): " pass\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_tabwidth_dedent(testroot): options = {'tab-width': 4, 'dedent': 4, 'pyobject': 'Qux.quux'} reader = LiteralIncludeReader(testroot / 'target.py', options, DUMMY_CONFIG) @@ -253,6 +271,7 @@ def test_LiteralIncludeReader_tabwidth_dedent(testroot): " pass\n") +@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows") def test_LiteralIncludeReader_diff(testroot, literal_inc_path): options = {'diff': testroot / 'literal-diff.inc'} reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG) |