Demonstrate that we don't need pytest-openfiles any more#14040
Demonstrate that we don't need pytest-openfiles any more#14040Cadair wants to merge 1 commit intoastropy:mainfrom
Conversation
|
Well that proved both hypotheses. https://github.com/astropy/astropy/actions/runs/3540889860/jobs/5944492676#step:9:1750 |
|
This looks good! I noticed that |
|
Well pytest-openfiles would catch the fixture if it were closed or unclosed, so it's not a surprise it gets it, what is a surprise is that it doesn't raise a resource warning. |
|
But we are also ignoring these. Does this mean we cannot ignore these no more? Lines 135 to 136 in b2b32a4 |
|
I would also be interested to see if #14041 would fail on these cases. Is there already such a PR somewhere? |
|
Those ignores aren't excluding open file resource warnings, just ones for SSL and socket? |
I ran into a pytest-openfiles bug astropy/pytest-openfiles#32 and it seems like we should just stop using it because pytest throws a
ResourceWarningnow which our default warnings filter converts into an exception.This PR adds some tests which leave open files hanging (and some which don't), my hypothesis is that all the CI jobs will fail and not just the one which uses
pytest-openfiles, if this is the case we can remove openfiles because it is redundant.Secondary hypothesis: More tests will fail on the pytest-openfiles build because of astropy/pytest-openfiles#32 that will fail on the other builds, but these fails are actually incorrect and shouldn't fail because the files are closed in the fixture teardown which happens after pytest-openfiles checks to see if the files are closed.