Skip to content

Commit

Permalink
Add test for pycontribs#110
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag committed Dec 22, 2023
1 parent 1681e02 commit 7e23a23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ repos:
- pytest>=6.1.2
- enrich>=1.2.5
- repo: https://github.com/PyCQA/pylint
rev: v3.0.0a6
rev: v3.0.3
hooks:
- id: pylint
additional_dependencies:
Expand Down
7 changes: 7 additions & 0 deletions test/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,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"

0 comments on commit 7e23a23

Please sign in to comment.