Download tasks/swe-next-6f59fc5cd8372ff0ed91/environment/source/tests/conftest.py from FineEnvs/repo2rlenv-swe-next: direct link, hf CLI and curl.
- Browser
- Download file 800 Bytes
-
https://huggingface.co/datasets/FineEnvs/repo2rlenv-swe-next/resolve/main/tasks/swe-next-6f59fc5cd8372ff0ed91/environment/source/tests/conftest.py
- Command line
-
hf download hf://datasets/FineEnvs/repo2rlenv-swe-next/tasks/swe-next-6f59fc5cd8372ff0ed91/environment/source/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/datasets/FineEnvs/repo2rlenv-swe-next/resolve/main/tasks/swe-next-6f59fc5cd8372ff0ed91/environment/source/tests/conftest.py
800 Bytes
| import sys | |
| import re | |
| _VERSION_MARKER = re.compile(r'_py(?P<major_version>\d)(?P<minor_version>\d)?') | |
| def pytest_ignore_collect(collection_path, config): | |
| """ | |
| Ignore tests that end with _pyX, where X does not equal this | |
| interpreter's major version. | |
| """ | |
| filename = collection_path.name | |
| modulename = filename.split('.', 1)[0] | |
| match = _VERSION_MARKER.search(modulename) | |
| if not match: | |
| return False | |
| major_version = match.group('major_version') | |
| minor_version = match.group('minor_version') | |
| if minor_version: | |
| version_match = (int(major_version), int(minor_version)) == sys.version_info[:2] | |
| else: | |
| version_match = int(major_version) == sys.version_info[0] | |
| return not version_match # because this is an _ignore_ (not an include) | |