-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test to run all example code, enable rx_proc.daemon
Needed to modify some of the example code ports to match up with the integration test script
- Loading branch information
1 parent
0f814e5
commit 274a431
Showing
4 changed files
with
30 additions
and
5 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
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
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
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,24 @@ | ||
import runpy | ||
import multiprocess as mp | ||
from pathlib import Path | ||
|
||
import pytest | ||
import _pytest.outcomes | ||
|
||
pytestmark = pytest.mark.fg_integration | ||
|
||
|
||
@pytest.mark.timeout(10) # Examples have infinite loops | ||
@pytest.mark.parametrize('example_script_path', Path(__file__, '..', '..', 'examples').resolve().glob('*.py')) | ||
def test_gui_rx_and_tx_integration(example_script_path: Path): | ||
try: | ||
runpy.run_path(str(example_script_path), run_name='__main__') | ||
except _pytest.outcomes.Failed as py_fail: | ||
# Timeout is expected, otherwise it's a real error | ||
if 'timeout' not in py_fail.msg.lower(): | ||
raise py_fail | ||
# With rx_proc.daemon this isn't strictly necessary, but without manually | ||
# calling terminate the callback process still seem to be running. So this | ||
# is still a good thing to do. | ||
for mp_child in mp.active_children(): | ||
mp_child.terminate() |