Skip to content

Make test_attrgetter_using test dependant. - #11293

Merged
AA-Turner merged 5 commits into
sphinx-doc:masterfrom
marxin:fix-test-tests/test_ext_autodoc.py
Jul 28, 2023
Merged

AA-Turner merged 5 commits into
sphinx-doc:masterfrom
marxin:fix-test-tests/test_ext_autodoc.py

Conversation

@marxin

@marxin marxin commented Apr 6, 2023

Copy link
Copy Markdown
Contributor

One cannot run the mentioned test individually and thus it brings troubles with pytest -n auto.

@AA-Turner

One cannot run the mentioned test individually and thus
it brings troubles with pytest -n auto.
@picnixz

picnixz commented Apr 6, 2023

Copy link
Copy Markdown
Member

Since your seem to fix those kind of tests, maybe you can gather them under the issue I created (which also includes a dependent test) #11285 or make a separate "summary" issue ? (so that we know which are the ones to fix / that were already fixed)

@marxin

marxin commented Apr 6, 2023

Copy link
Copy Markdown
Contributor Author

Sure, good point. Do you have any other tests that have a global context dependency?

@picnixz

picnixz commented Apr 6, 2023

Copy link
Copy Markdown
Member

Well, just running python -m tox -e py310 -- tests/test_ext_autodoc* would yield more failures but I don't know which test is dependent on which. I found the dependencies by explicitly testing different pairs (in the order they were specified when running python -m tox -e py310 -- tests/test_ext_autodoc*).

@marxin

marxin commented Apr 6, 2023

Copy link
Copy Markdown
Contributor Author

I see, I can confirm that as well with pytest tests/test_ext_autodoc.py --random-order. Can you please work on that :P ?

@picnixz

picnixz commented Apr 6, 2023 •

Copy link
Copy Markdown
Member

I see, I can confirm that as well with pytest tests/test_ext_autodoc.py --random-order. Can you please work on that :P ?

Well, I wonder actually about the way to patch this thing. Either we patch it by "cleanly" resetting things up, or we modify the flow of do_autodoc in the tests so that every autodoc test is independent. That's why I created #11285 in order to know which direction would be the best. Because I highly suspect that this is not the only test that has dependencies and that the whole testing flow should be revised.

@AA-Turner (for the ping) Can you tell us which direction would be the best ?

@AA-Turner

Copy link
Copy Markdown
Member

Either we patch it by "cleanly" resetting things up, or we modify the flow of do_autodoc in the tests so that every autodoc test is independent.

I'm not entirely what the two options are here, but I think philisophically we should try and eliminate implicit state between tests. I think every test should be independent, but if it makes the tests take much longer, perhaps we make any state that is needed explicit via module-level setup or fixtures etc?

A

@AA-Turner
AA-Turner merged commit 2c0b81d into sphinx-doc:master Jul 28, 2023
@marxin
marxin deleted the fix-test-tests/test_ext_autodoc.py branch July 28, 2023 14:20
@AA-Turner AA-Turner modified the milestones: some future version, 7.2.0 Aug 11, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants