Skip to content
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

aiida_profile test fixture leaves unclosed file in test suits #6271

Closed
unkcpz opened this issue Feb 1, 2024 · 1 comment
Closed

aiida_profile test fixture leaves unclosed file in test suits #6271

unkcpz opened this issue Feb 1, 2024 · 1 comment

Comments

@unkcpz
Copy link
Member

unkcpz commented Feb 1, 2024

A warning exception in AiiDAlab test, I can confirm it comes from the pytest_fixture and from aiida_profile of aiida.manage.tests.pytest_fixtures.

With a dummy test in aiidalab-widgets-base only load the aiida.manage.tests.pytest_fixtures. It appears after we turn on pytest option of show warning as error.

After I comment out the aiida_profile fixture, this warning disappeared.

tests/test_a.py::test_a Exception ignored in: <_io.FileIO name=6 mode='rb' closefd=True>
Traceback (most recent call last):
  File "/home/jyu/micromamba/envs/aiidalab-dev/lib/python3.9/site-packages/_pytest/unraisableexception.py", line 59, in __exit__
    del self.unraisable
ResourceWarning: unclosed file <_io.BufferedReader name=6>
Exception ignored in: <_io.FileIO name=8 mode='rb' closefd=True>
Traceback (most recent call last):
  File "/home/jyu/micromamba/envs/aiidalab-dev/lib/python3.9/site-packages/_pytest/unraisableexception.py", line 59, in __exit__
    del self.unraisable
ResourceWarning: unclosed file <_io.BufferedReader name=8>

Originally posted by @unkcpz in #6254 (comment)

Mirror of the issue aiidalab/aiidalab-widgets-base#551.

@sphuber
Copy link
Contributor

sphuber commented Apr 21, 2024

I cannot reproduce this with the new fixtures in aiida.tools.pytest_fixtures so I am closing this for now

@sphuber sphuber closed this as completed Apr 21, 2024
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

No branches or pull requests

2 participants