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

Eliminate warning in test suite #621

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Eliminate warning in test suite #621

merged 3 commits into from
Oct 16, 2024

Conversation

fyellin
Copy link
Contributor

@fyellin fyellin commented Oct 16, 2024

Runnng the test suite from the terminal gives the warning shown below. This makes this warning go away.

I haven't yet figured out a safe way to get rid of the other warning: /Users/fy/Pycharm/wgpu-py/wgpu/gui/glfw.py:557: DeprecationWarning: There is no current event loop

================================================================================================== warnings summary ==================================================================================================
tests/test_gui_base.py::test_base_canvas_context
  /Users/fy/Pycharm/wgpu-py/.venv/lib/python3.12/site-packages/_pytest/unraisableexception.py:80: PytestUnraisableExceptionWarning: Exception ignored in: <function GPUCanvasContext.__del__ at 0x102d51ee0>
  
  Traceback (most recent call last):
    File "/Users/fy/Pycharm/wgpu-py/wgpu/_classes.py", line 517, in __del__
      self._release()
    File "/Users/fy/Pycharm/wgpu-py/wgpu/_classes.py", line 520, in _release
      self._drop_texture()
    File "/Users/fy/Pycharm/wgpu-py/wgpu/_classes.py", line 442, in _drop_texture
      if self._texture:
         ^^^^^^^^^^^^^
  AttributeError: 'GPUCanvasContext' object has no attribute '_texture'
  
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

@fyellin fyellin requested a review from Korijn as a code owner October 16, 2024 04:30
Copy link
Member

@almarklein almarklein left a comment

Choose a reason for hiding this comment

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

I haven't yet figured out a safe way to get rid of the other warning: /Users/fy/Pycharm/wgpu-py/wgpu/gui/glfw.py:557: DeprecationWarning: There is no current event loop

This is because of asyncio.get_event_loop() being deprecated from Python 3.12. I'll probably address that in #618

wgpu/_classes.py Outdated Show resolved Hide resolved
fyellin and others added 2 commits October 16, 2024 09:00
Accidentally duplicated line

Co-authored-by: Almar Klein <[email protected]>
@Korijn Korijn merged commit e30c495 into pygfx:main Oct 16, 2024
21 checks passed
@fyellin fyellin deleted the kill_warning branch October 17, 2024 20:24
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