Skip to content

Commit

Permalink
Add test for #110 (#119)
Browse files Browse the repository at this point in the history
* Add test for #110

* Fix

---------

Co-authored-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
jonashaag and ssbarnea authored Mar 4, 2024
1 parent 1dd55a0 commit d82470d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions test/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,10 @@ def test_run_compat() -> None:
assert ours.stdout == original.stdout
assert ours.stderr == original.stderr
assert ours.args == original.args


def test_run_waits_for_completion(tmp_path):
"""run() should always wait for the process to complete."""
tmpfile = tmp_path / "output.txt"
run(f"sleep 0.1 && echo 42 > {str(tmpfile)}")
assert tmpfile.read_text() == "42\n"
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ passenv =
TERM
setenv =
PIP_DISABLE_VERSION_CHECK=1
PYTEST_REQPASS=15
py38: PYTEST_REQPASS=14
PYTEST_REQPASS=16
py38: PYTEST_REQPASS=15
PYTHONDONTWRITEBYTECODE=1
PYTHONUNBUFFERED=1
commands =
Expand Down

0 comments on commit d82470d

Please sign in to comment.