Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions autotest/test_example_scripts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import re
from functools import reduce
from os import linesep
from pprint import pprint

import pytest
Expand Down Expand Up @@ -35,7 +34,6 @@ def get_example_scripts(exclude=None):
@pytest.mark.parametrize("script", get_example_scripts())
def test_scripts(script):
stdout, stderr, returncode = run_py_script(script, verbose=True)

if returncode != 0:
if "Missing optional dependency" in stderr:
pkg = re.findall("Missing optional dependency '(.*)'", stderr)[0]
Expand All @@ -44,13 +42,3 @@ def test_scripts(script):
assert returncode == 0
pprint(stdout)
pprint(stderr)
# allowed_patterns = ["findfont", "warning", "loose", "match_original"]
# assert (
# not stderr
# or
# # trap warnings & non-fatal errors
# all(
# (not line or any(p in line.lower() for p in allowed_patterns))
# for line in stderr.split(linesep)
# )
# )
8 changes: 7 additions & 1 deletion autotest/test_notebooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import re
from pathlib import Path
from pprint import pprint

import pytest
from autotest.conftest import get_project_root_path
Expand All @@ -11,8 +13,10 @@ def get_notebooks(pattern=None, exclude=None):
nbpaths = [
str(p)
for p in (prjroot / ".docs" / "Notebooks").glob("*.py")
if pattern in p.name
if pattern is None or pattern in p.name
]

# sort for pytest-xdist: workers must collect tests in the same order
return sorted(
[p for p in nbpaths if not exclude or not any(e in p for e in exclude)]
)
Expand All @@ -39,3 +43,5 @@ def test_notebooks(notebook):
pytest.skip(f"notebook requires package {pkg!r}")

assert returncode == 0, f"could not run {notebook}"
pprint(stdout)
pprint(stderr)