Skip to content

@pytest.mark.slow and --runslow option #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2023
Merged

Conversation

honno
Copy link
Contributor

@honno honno commented Feb 27, 2023

  • Skips any test with the pytest.mark.slow marker by default like in NumPy
  • Introduces --runslow option to run these slow tests
  • Uses --runslow on our test CI

@honno honno requested a review from ev-br February 27, 2023 09:28
@honno
Copy link
Contributor Author

honno commented Feb 27, 2023

n.b. currently no test in our suite uses pytest.mark.slow (save a commented-out one in test_scalarmath.py), but I played with this manually and it worked fine.

@ev-br
Copy link
Collaborator

ev-br commented Feb 27, 2023

Thanks! This is a very welcome change!

Locally with a recent main branch, I see several uses of @slow, will double-check a bit later.

torch_np/tests/numpy_tests/core/test_multiarray.py:1015
torch_np/tests/numpy_tests/core/test_multiarray.py:1015
torch_np/tests/numpy_tests/core/test_multiarray.py:1015
torch_np/tests/numpy_tests/core/test_multiarray.py:1015
torch_np/tests/numpy_tests/core/test_multiarray.py:1015
torch_np/tests/numpy_tests/core/test_multiarray.py:1015
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:1015: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

torch_np/tests/numpy_tests/core/test_multiarray.py:1296
torch_np/tests/numpy_tests/core/test_multiarray.py:1296
torch_np/tests/numpy_tests/core/test_multiarray.py:1296
torch_np/tests/numpy_tests/core/test_multiarray.py:1296
torch_np/tests/numpy_tests/core/test_multiarray.py:1296
torch_np/tests/numpy_tests/core/test_multiarray.py:1296
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:1296: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

torch_np/tests/numpy_tests/core/test_multiarray.py:4649
torch_np/tests/numpy_tests/core/test_multiarray.py:4649
torch_np/tests/numpy_tests/core/test_multiarray.py:4649
torch_np/tests/numpy_tests/core/test_multiarray.py:4649
torch_np/tests/numpy_tests/core/test_multiarray.py:4649
torch_np/tests/numpy_tests/core/test_multiarray.py:4649
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:4649: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow  # takes > 1 minute on mechanical hard drive

torch_np/tests/numpy_tests/core/test_multiarray.py:5705
torch_np/tests/numpy_tests/core/test_multiarray.py:5705
torch_np/tests/numpy_tests/core/test_multiarray.py:5705
torch_np/tests/numpy_tests/core/test_multiarray.py:5705
torch_np/tests/numpy_tests/core/test_multiarray.py:5705
torch_np/tests/numpy_tests/core/test_multiarray.py:5705
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:5705: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

torch_np/tests/numpy_tests/core/test_multiarray.py:6919
torch_np/tests/numpy_tests/core/test_multiarray.py:6919
torch_np/tests/numpy_tests/core/test_multiarray.py:6919
torch_np/tests/numpy_tests/core/test_multiarray.py:6919
torch_np/tests/numpy_tests/core/test_multiarray.py:6919
torch_np/tests/numpy_tests/core/test_multiarray.py:6919
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:6919: PytestUnknownMarkWarning: Unknown pytest.mark.valgrind_error - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.valgrind_error(reason="leaks buffer info cache temporarily.")

torch_np/tests/numpy_tests/core/test_multiarray.py:6944
torch_np/tests/numpy_tests/core/test_multiarray.py:6944
torch_np/tests/numpy_tests/core/test_multiarray.py:6944
torch_np/tests/numpy_tests/core/test_multiarray.py:6944
torch_np/tests/numpy_tests/core/test_multiarray.py:6944
torch_np/tests/numpy_tests/core/test_multiarray.py:6944
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:6944: PytestUnknownMarkWarning: Unknown pytest.mark.valgrind_error - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.valgrind_error(reason="leaks buffer info cache temporarily.")

torch_np/tests/numpy_tests/core/test_multiarray.py:6978
torch_np/tests/numpy_tests/core/test_multiarray.py:6978
torch_np/tests/numpy_tests/core/test_multiarray.py:6978
torch_np/tests/numpy_tests/core/test_multiarray.py:6978
torch_np/tests/numpy_tests/core/test_multiarray.py:6978
torch_np/tests/numpy_tests/core/test_multiarray.py:6978
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:6978: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

torch_np/tests/numpy_tests/core/test_multiarray.py:7857
torch_np/tests/numpy_tests/core/test_multiarray.py:7857
torch_np/tests/numpy_tests/core/test_multiarray.py:7857
torch_np/tests/numpy_tests/core/test_multiarray.py:7857
torch_np/tests/numpy_tests/core/test_multiarray.py:7857
torch_np/tests/numpy_tests/core/test_multiarray.py:7857
  /home/br/sweethome/proj/scipy/torch_np_compat/torch_np/tests/numpy_tests/core/test_multiarray.py:7857: PytestUnknownMarkWarning: Unknown pytest.mark.leaks_references - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.leaks_references(

@honno
Copy link
Contributor Author

honno commented Feb 27, 2023

Locally with a recent main branch, I see several uses of @slow, will double-check a bit later.

Ah I see, screwed up the grep when I was searching is all 😅

@ev-br
Copy link
Collaborator

ev-br commented Feb 27, 2023

'later' turned out to be 'now'. Checked it locally, and it does cut the noise! Test suite is still dominated by error processing from xfailed tests, but this is a great change regardless. Thank @honno

@ev-br ev-br merged commit 1ca7255 into Quansight-Labs:main Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants