Skip to content

Commit

Permalink
Use no_block when running examples on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
xioTechnologies authored Sep 27, 2023
1 parent ba6975c commit df9e2de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
CIBW_BUILD: ${{ matrix.python-version }}${{ matrix.target[1] }}
CIBW_BEFORE_BUILD: pip install numpy
CIBW_BEFORE_TEST: pip install numpy matplotlib
CIBW_TEST_COMMAND: cd {project}/Python && python advanced_example.py dont_show && python simple_example.py dont_show
CIBW_TEST_COMMAND_WINDOWS: cd /D {project}/Python && python advanced_example.py dont_show && python simple_example.py dont_show
CIBW_TEST_COMMAND: cd {project}/Python && python advanced_example.py no_block && python simple_example.py no_block
CIBW_TEST_COMMAND_WINDOWS: cd /D {project}/Python && python advanced_example.py no_block && python simple_example.py no_block

- if: startsWith(github.ref, 'refs/tags/v')
name: Upload wheel
Expand Down
3 changes: 1 addition & 2 deletions Python/advanced_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,4 @@ def plot_bool(axis, x, y, label):

plot_bool(axes[10], timestamp, flags[:, 3], "Magnetic recovery")

if len(sys.argv) == 1: # don't show plots when script run by CI
pyplot.show()
pyplot.show(block="no_block" not in sys.argv) # don't block when script run by CI
3 changes: 1 addition & 2 deletions Python/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@
axes[2].grid()
axes[2].legend()

if len(sys.argv) == 1: # don't show plots when script run by CI
pyplot.show()
pyplot.show(block="no_block" not in sys.argv) # don't block when script run by CI

0 comments on commit df9e2de

Please sign in to comment.