Skip to content

Commit 2d712da

Browse files
committed
[py] Fix pytest path warning
1 parent 1aa38be commit 2d712da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

py/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import os
1919
import platform
20+
from pathlib import Path
2021

2122
import pytest
2223

@@ -84,13 +85,12 @@ def pytest_addoption(parser):
8485
)
8586

8687

87-
def pytest_ignore_collect(path, config):
88+
def pytest_ignore_collect(collection_path, config):
8889
drivers_opt = config.getoption("drivers")
8990
_drivers = set(drivers).difference(drivers_opt or drivers)
9091
if drivers_opt:
9192
_drivers.add("unit")
92-
parts = path.dirname.split(os.path.sep)
93-
return len([d for d in _drivers if d.lower() in parts]) > 0
93+
return len([d for d in _drivers if d.lower() in collection_path.parts]) > 0
9494

9595

9696
def pytest_generate_tests(metafunc):
@@ -298,7 +298,7 @@ def server(request):
298298
# under Wayland, so we use XWayland instead.
299299
remote_env["MOZ_ENABLE_WAYLAND"] = "0"
300300

301-
if os.path.exists(jar_path):
301+
if Path(jar_path).exists():
302302
# use the grid server built by bazel
303303
server = Server(path=jar_path, env=remote_env)
304304
else:

0 commit comments

Comments
 (0)