55
66import pytest
77
8+ from sphinxcontrib .versioning .git import IS_WINDOWS
9+
810
911def test_sub_page_and_tag (tmpdir , local_docs , run , urls ):
1012 """Test with sub pages and one git tag. Testing from local git repo.
@@ -282,7 +284,7 @@ def test_root_ref(tmpdir, local_docs, run, no_tags):
282284 else :
283285 assert 'No git tags with docs found in remote. Falling back to --root-ref value.' not in output
284286 # Check output.
285- assert 'Root ref is: {}\n ' .format (expected ) in output
287+ assert 'Root ref is: {}' .format (expected ) in output
286288
287289
288290@pytest .mark .parametrize ('parallel' , [False , True ])
@@ -295,6 +297,8 @@ def test_add_remove_docs(tmpdir, local_docs, run, urls, parallel):
295297 :param urls: conftest fixture.
296298 :param bool parallel: Run sphinx-build with -j option.
297299 """
300+ if parallel and IS_WINDOWS :
301+ return pytest .skip ('Sphinx parallel feature not available on Windows.' )
298302 run (local_docs , ['git' , 'tag' , 'v1.0.0' ])
299303
300304 # Move once.
@@ -544,8 +548,8 @@ def test_whitelisting(local_docs, run, urls):
544548 assert 'Traceback' not in output
545549
546550 # Check output.
547- assert 'With docs: ignored included master v1.0 v1.0-dev\n ' in output
548- assert 'Passed whitelisting: included master v1.0\n ' in output
551+ assert 'With docs: ignored included master v1.0 v1.0-dev' in output
552+ assert 'Passed whitelisting: included master v1.0' in output
549553
550554 # Check root.
551555 urls (local_docs .join ('html' , 'contents.html' ), [
@@ -639,12 +643,12 @@ def test_error_bad_path(tmpdir, run):
639643 """
640644 with pytest .raises (CalledProcessError ) as exc :
641645 run (tmpdir , ['sphinx-versioning' , '-N' , '-c' , 'unknown' , 'build' , '.' , str (tmpdir )])
642- assert 'Directory "unknown" does not exist.\n ' in exc .value .output
646+ assert 'Directory "unknown" does not exist.' in exc .value .output
643647
644648 tmpdir .ensure ('is_file' )
645649 with pytest .raises (CalledProcessError ) as exc :
646650 run (tmpdir , ['sphinx-versioning' , '-N' , '-c' , 'is_file' , 'build' , '.' , str (tmpdir )])
647- assert 'Directory "is_file" is a file.\n ' in exc .value .output
651+ assert 'Directory "is_file" is a file.' in exc .value .output
648652
649653 with pytest .raises (CalledProcessError ) as exc :
650654 run (tmpdir , ['sphinx-versioning' , '-N' , 'build' , '.' , str (tmpdir )])
@@ -667,7 +671,7 @@ def test_error_no_docs_found(tmpdir, local, run):
667671 """
668672 with pytest .raises (CalledProcessError ) as exc :
669673 run (local , ['sphinx-versioning' , '-N' , '-v' , 'build' , '.' , str (tmpdir )])
670- assert 'No docs found in any remote branch/tag. Nothing to do.\n ' in exc .value .output
674+ assert 'No docs found in any remote branch/tag. Nothing to do.' in exc .value .output
671675
672676
673677def test_error_bad_root_ref (tmpdir , local_docs , run ):
@@ -679,4 +683,4 @@ def test_error_bad_root_ref(tmpdir, local_docs, run):
679683 """
680684 with pytest .raises (CalledProcessError ) as exc :
681685 run (local_docs , ['sphinx-versioning' , '-N' , '-v' , 'build' , '.' , str (tmpdir ), '-r' , 'unknown' ])
682- assert 'Root ref unknown not found in: master\n ' in exc .value .output
686+ assert 'Root ref unknown not found in: master' in exc .value .output
0 commit comments