Skip to content

Commit 3e3ce8c

Browse files
gnufedegithub-actions[bot]
authored andcommitted
ci: remove pytest_ignore_collect hook (#8582)
CI: Remove unused hook that is giving problems with pytest 8.1 ## Checklist - [x] Change(s) are motivated and described in the PR description - [x] Testing strategy is described if automated tests are not included in the PR - [x] Risks are described (performance impact, potential for breakage, maintainability) - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) (cherry picked from commit 688074a)
1 parent 4a27513 commit 3e3ce8c

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

conftest.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -64,47 +64,6 @@ def pytest_configure(config):
6464
config.option.benchmark_save = str(time()).replace(".", "_") + gc + "_py%d_%d" % sys.version_info[:2]
6565

6666

67-
# Determine if the folder should be ignored
68-
# https://docs.pytest.org/en/3.10.1/reference.html#_pytest.hookspec.pytest_ignore_collect
69-
# DEV: We can only ignore folders/modules, we cannot ignore individual files
70-
# DEV: We must wrap with `@pytest.mark.hookwrapper` to inherit from default (e.g. honor `--ignore`)
71-
# https://github.com/pytest-dev/pytest/issues/846#issuecomment-122129189
72-
@pytest.hookimpl(hookwrapper=True)
73-
def pytest_ignore_collect(path, config):
74-
"""
75-
Skip directories defining a required minimum Python version
76-
77-
Example::
78-
79-
File: tests/contrib/vertica/py35/test.py
80-
Python 2.7: Skip
81-
Python 3.4: Skip
82-
Python 3.5: Collect
83-
Python 3.6: Collect
84-
"""
85-
# Execute original behavior first
86-
# DEV: We need to set `outcome.force_result(True)` if we need to override
87-
# these results and skip this directory
88-
outcome = yield
89-
90-
# Was not ignored by default behavior
91-
if not outcome.get_result():
92-
# DEV: `path` is a `LocalPath`
93-
path = str(path)
94-
if not os.path.isdir(path):
95-
path = os.path.dirname(path)
96-
dirname = os.path.basename(path)
97-
98-
# Directory name match `py[23][0-9]`
99-
if PY_DIR_PATTERN.match(dirname):
100-
# Split out version numbers into a tuple: `py35` -> `(3, 5)`
101-
min_required = tuple((int(v) for v in dirname.strip("py")))
102-
103-
# If the current Python version does not meet the minimum required, skip this directory
104-
if sys.version_info[0:2] < min_required:
105-
outcome.force_result(True)
106-
107-
10867
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
10968
def pytest_runtest_makereport(item, call):
11069
# Attach the outcome of the test (failed, passed, skipped) to the test node so that fixtures

0 commit comments

Comments
 (0)