Skip to content

Conversation

@andfoy
Copy link
Contributor

@andfoy andfoy commented Apr 18, 2025

Fixes #46

This PR enables reporting tests that were marked as single-threaded using @pytest.mark.parallel_threads(1), as they were not being reported before

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Additionally, I think that the Some tests *not* run in parallel line appearing even if all tests were run in parallel is also a bug that should be fixed and which is why I opened #46 initially. For example, just running test_resolver.py gives me the following.

================================================================== test session starts ===================================================================
platform darwin -- Python 3.13.2+, pytest-8.3.5, pluggy-1.5.0
rootdir: /Users/lysnikolaou/repos/quansight/pyyaml
configfile: pyproject.toml
plugins: run-parallel-0.4.0
collected 3 items                                                                                                                                        
Collected 3 items to run in parallel

tests/free_threading/test_resolver.py ···                                                                                                          [100%]

************************************************************ Some tests *not* run in parallel ************************************************************
0 tests were not run in parallel because of use of thread-unsafe functionality, to list the tests that were skipped, re-run while setting PYTEST_RUN_PARALLEL_VERBOSE=1 in your shell environment
=================================================================== 3 passed in 0.77s ====================================================================

@andfoy
Copy link
Contributor Author

andfoy commented Apr 18, 2025

Would we agree to rephrase it as thread-unsafe test report or something alongside those lines? Or should we omit the report altogether if there is nothing to report?

@lysnikolaou
Copy link
Member

I'd be okay always showing. If all tests were run in parallel, then we could have something like this:

************************************************************ pytest-run-parallel report ************************************************************
All tests were run in parallel! 🎉 

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test for the new message if all tests were run in parallel?

@andfoy
Copy link
Contributor Author

andfoy commented Apr 22, 2025

@lysnikolaou @ngoldbaum do you have any additional comments? Or should we merge this one?

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ngoldbaum ngoldbaum merged commit f5418b6 into main Apr 22, 2025
9 checks passed
@andfoy andfoy deleted the report_manually_marked_tests branch April 22, 2025 16:48
@andfoy
Copy link
Contributor Author

andfoy commented Apr 22, 2025

Let me produce a new release!

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.

Message that some tests were not run in parallel even if they all did

4 participants