Skip to content
Myr

✅ Generalize test suite to run on Windows (#810)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sofie Van Landeghem · committed by GitHub · parent 8f11d2e · Browse files · 2 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−6 removed

  • tests:+6 added−6 removed

2 files+6 added−6 removed

modified:tests/test_completion/test_completion_install.py+3 added-3 removed
50 unmodified lines
51 },52 )53 new_text = bash_completion_path.read_text()54 bash_completion_path.write_text(text)55 install_source = ".bash_completions/tutorial001.py.sh"56 assert install_source not in text57 assert install_source in new_text55 install_source = Path(".bash_completions/tutorial001.py.sh")56 assert str(install_source) not in text57 assert str(install_source) in new_text58 assert "completion installed in" in result.stdout59 assert "Completion will take effect once you restart the terminal" in result.stdout60 install_source_path = Path.home() / install_source61 assert install_source_path.is_file()
109 unmodified lines
modified:tests/test_completion/test_completion.py+3 added-3 removed
9 unmodified lines
10 result = subprocess.run(11 [12 "bash",13 "-c",14 f"{sys.executable} -m coverage run {mod.__file__} --show-completion",14 f"'{sys.executable}' -m coverage run '{mod.__file__}' --show-completion",15 ],16 capture_output=True,17 encoding="utf-8",18 env={**os.environ, "SHELL": "/bin/bash", "_TYPER_COMPLETE_TESTING": "True"},
9 unmodified lines
28 result = subprocess.run(29 [30 "bash",31 "-c",32 f"{sys.executable} -m coverage run {mod.__file__} --install-completion",32 f"'{sys.executable}' -m coverage run '{mod.__file__}' --install-completion",33 ],34 capture_output=True,35 encoding="utf-8",36 env={**os.environ, "SHELL": "/bin/bash", "_TYPER_COMPLETE_TESTING": "True"},37 )38 new_text = bash_completion_path.read_text()39 bash_completion_path.write_text(text)40 assert "source" in new_text41 assert ".bash_completions/tutorial001.py.sh" in new_text41 assert str(Path(".bash_completions/tutorial001.py.sh")) in new_text42 assert "completion installed in" in result.stdout43 assert "Completion will take effect once you restart the terminal" in result.stdout4445
112 unmodified lines