Skip to content
Merged
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
8 changes: 1 addition & 7 deletions tests/test_examples_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"""

import os
import shutil
import subprocess
import sys
from pathlib import Path
Expand All @@ -22,6 +21,7 @@
EXAMPLES = Path(__file__).resolve().parents[1] / "examples"

SKIP = {
"blobs2.py": "runs Graphviz dot and opens the resulting PDF in a browser",
"bunny.py": "opens an Open3D window",
"showzip.py": "opens OpenCV windows and waits for key presses",
"randomdots.py": "interactive threshold window",
Expand All @@ -34,9 +34,6 @@
NETWORK = {"monalisa.py"}
NETWORK_ERRORS = ("URLError", "ConnectionError", "TimeoutError", "HTTPError", "gaierror")

# examples that run an external program: skipped when it is not installed
NEEDS_PROGRAM = {"blobs2.py": "dot"} # Graphviz

# morphdemo redraws the figure for every pixel, which is slow on a CI runner; a
# few frames exercise the same code as all of them
ARGS = {"morphdemo.py": ["--delay", "0", "--frames", "5"]}
Expand All @@ -46,9 +43,6 @@
def test_example_runs(script):
if script in SKIP:
pytest.skip(SKIP[script])
if script in NEEDS_PROGRAM and shutil.which(NEEDS_PROGRAM[script]) is None:
pytest.skip(f"needs {NEEDS_PROGRAM[script]} on the PATH")

# UTF-8 output, since examples print maths symbols that the Windows default cannot encode
env = dict(os.environ, MPLBACKEND="Agg", PYTHONUTF8="1", PYTHONIOENCODING="utf-8")
result = subprocess.run(
Expand Down
Loading