Skip to content

Commit f56b77a

Browse files
committed
Fix for pytest >= 8
1 parent da3ea8b commit f56b77a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

conftest.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1+
from pathlib import Path
12
import math
2-
33
import numpy
44
import pytest
55

66
import compas
77
from compas.geometry import allclose
88

99

10-
def pytest_ignore_collect(path):
11-
if "rhino" in str(path):
12-
return True
13-
14-
if "blender" in str(path):
10+
def pytest_ignore_collect(collection_path: Path, config):
11+
# Skip anything under rhino/blender/ghpython, or files ending with _cli.py
12+
parts_lower = {p.lower() for p in collection_path.parts}
13+
if {"rhino", "blender", "ghpython"} & parts_lower:
1514
return True
1615

17-
if "ghpython" in str(path):
16+
if collection_path.name.endswith("_cli.py"):
1817
return True
1918

20-
if str(path).endswith("_cli.py"):
21-
return True
19+
# return None -> don't ignore
20+
return None
2221

2322

2423
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)