Skip to content

Commit

Permalink
✅ Generalize test suite to run on Windows (#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
svlandeg committed May 2, 2024
1 parent 8f11d2e commit 77adc6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/test_completion/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_show_completion():
[
"bash",
"-c",
f"{sys.executable} -m coverage run {mod.__file__} --show-completion",
f"'{sys.executable}' -m coverage run '{mod.__file__}' --show-completion",
],
capture_output=True,
encoding="utf-8",
Expand All @@ -29,7 +29,7 @@ def test_install_completion():
[
"bash",
"-c",
f"{sys.executable} -m coverage run {mod.__file__} --install-completion",
f"'{sys.executable}' -m coverage run '{mod.__file__}' --install-completion",
],
capture_output=True,
encoding="utf-8",
Expand All @@ -38,7 +38,7 @@ def test_install_completion():
new_text = bash_completion_path.read_text()
bash_completion_path.write_text(text)
assert "source" in new_text
assert ".bash_completions/tutorial001.py.sh" in new_text
assert str(Path(".bash_completions/tutorial001.py.sh")) in new_text
assert "completion installed in" in result.stdout
assert "Completion will take effect once you restart the terminal" in result.stdout

Expand Down
6 changes: 3 additions & 3 deletions tests/test_completion/test_completion_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def test_completion_install_bash():
)
new_text = bash_completion_path.read_text()
bash_completion_path.write_text(text)
install_source = ".bash_completions/tutorial001.py.sh"
assert install_source not in text
assert install_source in new_text
install_source = Path(".bash_completions/tutorial001.py.sh")
assert str(install_source) not in text
assert str(install_source) in new_text
assert "completion installed in" in result.stdout
assert "Completion will take effect once you restart the terminal" in result.stdout
install_source_path = Path.home() / install_source
Expand Down

0 comments on commit 77adc6e

Please sign in to comment.