-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_generate_patches.py: Add test_read_incrementally_from_subprocess()
Mark this test as exploratory (that is, not testing the final code), and slow (because it uses time.sleep()). To do this, configure available marks via newly introduced 'pytest.ini'. https://docs.pytest.org/en/stable/how-to/mark.html#registering-marks https://docs.pytest.org/en/stable/how-to/usage.html#specifying-which-tests-to-run This test uses a helper script in newly introduced tests/helpers/ subdirectory.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[pytest] | ||
addopts = --strict-markers | ||
markers = | ||
slow: marks tests as slow (deselect with '-m "not slow"') | ||
explore: exploratory tests (deselect with '-m "not explore"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python | ||
"""Generates output incrementally, flushing after each line""" | ||
import time | ||
|
||
print("Split line first part", end="", flush=True) | ||
time.sleep(0.6) | ||
print(", second part", flush=True) | ||
|
||
print("2nd line", flush=True) | ||
time.sleep(1.0) | ||
print("3rd line (last line)", flush=True) | ||
|
||
# end of spew.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters