Skip to content

Conversation

@chrisinmtown
Copy link
Contributor

This allows limiting the scope of the test run, which can save much time.

Run one test in one test environment:

tox -e py39 -- tests/test_api.py::test_api

Run one test in all test environments:

tox -- tests/test_api.py::test_api

Run all tests in one file in one test environment:

tox -e py39 -- tests/test_api.py

Run all tests in one file in all test environments:

tox -- tests/test_api.py

@chrisinmtown
Copy link
Contributor Author

chrisinmtown commented Jul 17, 2025

I'm impatient :) and don't like waiting for all 802 tests to run in all 6 test environments. This change makes it possible for faster code-test cycles. Please consider, comment, etc., thank you.

@coveralls
Copy link

coveralls commented Jul 17, 2025

Coverage Status

coverage: 94.292%. remained the same
when pulling 38384c4 on chrisinmtown:add-tox-tests-posargs
into 0bf9d1f on spec-first:main.

@chrisinmtown
Copy link
Contributor Author

Greetings @Ruwann and @RobbeSneyders will you please review this contribution? Thanks.

…tion

This allows limiting the scope of the test run, which can save much time.

Run one test in one test environment:

    tox -e py39 -- tests/test_api.py::test_api

Run one test in all test environments:

    tox -- tests/test_api.py::test_api

Run all tests in one file in one test environment:

    tox -e py39 -- tests/test_api.py

Run all tests in one file in all test environments:

    tox -- tests/test_api.py
@chrisinmtown chrisinmtown force-pushed the add-tox-tests-posargs branch from 861ab3d to 68550f4 Compare October 6, 2025 12:09
@chrisinmtown
Copy link
Contributor Author

@RobbeSneyders I see you were debugging a problem today with the tests in 3.14. This tiny change makes that easier by allowing you to run tests in only that environment. Please consider a merge here?

Copy link
Member

@RobbeSneyders RobbeSneyders left a comment

Choose a reason for hiding this comment

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

Thanks @chrisinmtown

@RobbeSneyders RobbeSneyders merged commit dd30548 into spec-first:main Oct 13, 2025
9 checks passed
@chrisinmtown
Copy link
Contributor Author

It looks like I didn't test this enough. As far as I can tell, when poetry invokes pytest, it ignores the options in the tox.ini file. So when I removed the argument "tests" from that invocation, it caused damage. I will put up a new PR to back out some of the damage that caused.

@chrisinmtown
Copy link
Contributor Author

Please see a minor change to a problem introduced here: #2092

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.

3 participants