Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 60cf919

Browse filesBrowse files
authored
FASTPLOTLIB_NB_TESTS required for nb test funcs to run (#460)
1 parent 0021652 commit 60cf919
Copy full SHA for 60cf919

File tree

2 files changed

+16
-1
lines changed
Filter options

2 files changed

+16
-1
lines changed

‎.github/workflows/ci.yml

Copy file name to clipboardExpand all lines: .github/workflows/ci.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
PYGFX_EXPECT_LAVAPIPE: true
9494
run: |
9595
pytest -v examples
96-
pytest --nbmake examples/notebooks/
96+
FASTPLOTLIB_NB_TESTS=1 pytest --nbmake examples/notebooks/
9797
- uses: actions/upload-artifact@v3
9898
if: ${{ failure() }}
9999
with:

‎examples/notebooks/nb_test_utils.py

Copy file name to clipboardExpand all lines: examples/notebooks/nb_test_utils.py
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@
2121
FAILURES = list()
2222

2323

24+
def _run_tests():
25+
if "FASTPLOTLIB_NB_TESTS" not in os.environ.keys():
26+
return False
27+
28+
if os.environ["FASTPLOTLIB_NB_TESTS"] == "1":
29+
return True
30+
31+
return False
32+
33+
2434
def plot_test(name, plot: Union[Plot, GridPlot]):
35+
if not _run_tests():
36+
return
2537
snapshot = plot.canvas.snapshot()
2638

2739
if "REGENERATE_SCREENSHOTS" in os.environ.keys():
@@ -81,6 +93,9 @@ def get_diffs_rgba(slicer):
8193

8294

8395
def notebook_finished():
96+
if not _run_tests():
97+
return
98+
8499
if len(FAILURES) > 0:
85100
raise AssertionError(
86101
f"Failures for plots:\n{FAILURES}"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.