Skip to content

Commit 39501b8

Browse files
authored
Fix pytest.skip for MacOS in test_tutorials.py (#2547)
1 parent 6a69c80 commit 39501b8

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

tests/integration/tutorials/test_tutorials.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
2-
FInd and run all tutorials in the doc/tutorials directory
2+
Find and run all tutorials in the doc/tutorials directory
33
"""
44
import io
55
import os
66
import contextlib
77
from importlib.machinery import SourceFileLoader
88
from pathlib import Path
9-
import platform
9+
import sys
1010

1111
import pytest
1212
import arcade
@@ -16,18 +16,10 @@
1616

1717

1818
def find_tutorials():
19-
# Loop the directory of tutorials dirs
20-
for dir in TUTORIAL_DIR.iterdir():
21-
if not dir.is_dir():
19+
for path in TUTORIAL_DIR.rglob("*.py"):
20+
if path.stem.startswith("_"):
2221
continue
23-
24-
print(dir)
25-
# Find python files in each tutorial dir
26-
for file in dir.glob("*.py"):
27-
if file.stem.startswith("_"):
28-
continue
29-
# print("->", file)
30-
yield file, file.stem in ALLOW_STDOUT
22+
yield path, path.stem in ALLOW_STDOUT
3123

3224

3325
@pytest.mark.parametrize(
@@ -36,8 +28,8 @@ def find_tutorials():
3628
)
3729
def test_tutorials(window_proxy, file_path, allow_stdout):
3830
"""Run all tutorials"""
39-
if "compute_shader" in str(file_path) and platform.system() == "darwin":
40-
raise pytest.skip(f"compute_shader tutorial not working on OS X")
31+
if file_path.parent.name == "compute_shader" and sys.platform == "darwin":
32+
raise pytest.skip("compute_shader tutorial not working on MacOS")
4133

4234
os.environ["ARCADE_TEST"] = "TRUE"
4335
stdout = io.StringIO()

0 commit comments

Comments
 (0)