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

ResourceWarning in build log when running tests - unclosed file #1193

Open
parthea opened this issue Dec 2, 2023 · 0 comments
Open

ResourceWarning in build log when running tests - unclosed file #1193

parthea opened this issue Dec 2, 2023 · 0 comments
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. type: cleanup An internal cleanup or hygiene concern.

Comments

@parthea
Copy link
Contributor

parthea commented Dec 2, 2023

See the Kokoro build log which contains the following warning:

>               warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E               pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
E               
E               Traceback (most recent call last):
E                 File "/tmpfs/src/github/python-storage/.nox/unit-3-8/lib/python3.8/site-packages/mock/mock.py", line 2212, in _mock_set_magics
E                   setattr(_type, entry, MagicProxy(entry, self))
E               ResourceWarning: unclosed file <_io.FileIO name=12 mode='rb+' closefd=True>

If we treat warnings as errors the following tests fail:

FAILED tests/unit/test_transfer_manager.py::test_upload_many_passes_concurrency_options - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/unit/test_transfer_manager.py::test_threads_deprecation_conflict_with_upload - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/unit/test_transfer_manager.py::test_upload_many_with_processes_rejects_file_obj - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/unit/test_transfer_manager.py::test_download_many_passes_concurrency_options - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
FAILED tests/unit/test_transfer_manager.py::test_download_many_with_processes_rejects_file_obj - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <_io.FileIO [closed]>
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/python-storage API. label Dec 2, 2023
parthea added a commit that referenced this issue Dec 2, 2023
@parthea parthea changed the title ResourceWarning in build log when running tests - unclosed file <_io.FileIO name=12 mode='rb+' closefd=True> ResourceWarning in build log when running tests - unclosed file Dec 2, 2023
parthea added a commit that referenced this issue Dec 2, 2023
@parthea parthea added the type: cleanup An internal cleanup or hygiene concern. label Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

2 participants