Fix missing tests on test tool lint job (#143052)

A follow-up from https://github.com/pytorch/pytorch/pull/142476#discussion_r1878888558 where some tests are not discovered correctly by pytest

### Testing

https://github.com/pytorch/pytorch/actions/runs/12287448581/job/34289531307?pr=143052#step:14:162 shows the correct number of tests now
Pull Request resolved: https://github.com/pytorch/pytorch/pull/143052
Approved by: https://github.com/ZainRizvi
This commit is contained in:
Huy Do
2024-12-12 20:29:32 +00:00
committed by PyTorch MergeBot
parent 82ce888273
commit 39cacc1d81
2 changed files with 6 additions and 2 deletions

View File

@ -207,8 +207,8 @@ jobs:
conda activate "${CONDA_ENV}"
# Test tools
PYTHONPATH=$(pwd) pytest tools/test/test_*.py
PYTHONPATH=$(pwd) pytest .github/scripts/test_*.py
PYTHONPATH=$(pwd) pytest tools/test -o "python_files=test*.py"
PYTHONPATH=$(pwd) pytest .github/scripts -o "python_files=test*.py"
test_run_test:
name: Test `run_test.py` is usable without boto3

View File

@ -26,6 +26,10 @@ class TestRun:
str
] # If non-empy, only these tests should be run in this test run
# NB: Also the class is called TestRun, it's not a test class, so having this field set
# will allow pytest to ignore this accordingly
__test__ = False
def __init__(
self,
name: str,