Skip to content

Commit

Permalink
add prints and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Jan 18, 2025
1 parent 4c69b9c commit 5af04d0
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions tests/test_empty_output/test_empty_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,14 @@ def _run_subprocess(script):


def test_empty_output():
output_verbose = subprocess.run(
[sys.executable, "-u", verbose_file],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
bufsize=1, # Line buffered
env={**os.environ, "PYTHONUNBUFFERED": "1"},
)
output_non_verbose = subprocess.run(
["python", non_verbose_file], stdout=subprocess.PIPE
)

stdout_verb, stderr_verb = _run_subprocess(verbose_file)
stdout_non_verb, stderr_non_verb = _run_subprocess(non_verbose_file)

print("\n stdout_verb \n", stdout_verb, "\n")
print("\n stderr_verb \n", stderr_verb, "\n")

print("\n stdout_non_verb \n", stdout_non_verb, "\n")
print("\n stderr_non_verb \n", stderr_non_verb, "\n")

assert "Results:" in stdout_verb
assert not stdout_non_verb

0 comments on commit 5af04d0

Please sign in to comment.