gentoo/dev-python/selenium/files/selenium-4.33.0-pytest-ignore.patch
Michał Górny ccc6c93b9d
dev-python/selenium: Bump to 4.33.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
2025-05-24 08:10:54 +02:00

30 lines
1.2 KiB
Diff

From d4efc1b1f38611984b9d4f3c3aac1ba37224e8d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sat, 24 May 2025 06:54:07 +0200
Subject: [PATCH] [py] Fix pytest_ignore_collect hook to respect --ignore
Fix the `pytest_ignore_collect` hook to respect `--ignore` specified
by the user. Returning `False` stops pytest from consulting additional
hooks, including its default hooks that are necessary to process
`--ignore` option. By returning `True` or `None`, the hook combines
files ignored by default with ignores specified by the user.
---
py/conftest.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/py/conftest.py b/py/conftest.py
index 2c4d0e62d6..45e5c704f8 100644
--- a/py/conftest.py
+++ b/py/conftest.py
@@ -90,7 +90,9 @@ def pytest_ignore_collect(collection_path, config):
_drivers = set(drivers).difference(drivers_opt or drivers)
if drivers_opt:
_drivers.add("unit")
- return len([d for d in _drivers if d.lower() in collection_path.parts]) > 0
+ if len([d for d in _drivers if d.lower() in collection_path.parts]) > 0:
+ return True
+ return None
def pytest_generate_tests(metafunc):