Download tests/test_py37_syntax.py from elyanlabs/trashclaw: direct link, hf CLI and curl.
- Browser
- Download file 756 Bytes
-
https://huggingface.co/elyanlabs/trashclaw/resolve/main/tests/test_py37_syntax.py
- Command line
-
hf download hf://elyanlabs/trashclaw/tests/test_py37_syntax.py
-
curl -L -o test_py37_syntax.py https://huggingface.co/elyanlabs/trashclaw/resolve/main/tests/test_py37_syntax.py
756 Bytes
| # SPDX-License-Identifier: MIT | |
| """TrashClaw runs on old machines: the main file and plugins must parse | |
| with Python 3.7 grammar (no walrus, positional-only params, match, etc.).""" | |
| import ast | |
| import glob | |
| import os | |
| import sys | |
| import pytest | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| FILES = [os.path.join(ROOT, "trashclaw.py")] + sorted( | |
| glob.glob(os.path.join(ROOT, "plugins", "*.py"))) | |
| def test_parses_as_python37(path): | |
| with open(path, encoding="utf-8") as f: | |
| source = f.read() | |
| ast.parse(source, filename=path, feature_version=(3, 7)) | |