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

Pytest 6.2.5: Unraisable Exception Warning #110

Closed
Hellseher opened this issue Oct 12, 2022 · 5 comments
Closed

Pytest 6.2.5: Unraisable Exception Warning #110

Hellseher opened this issue Oct 12, 2022 · 5 comments
Labels
bug A report of or a fix for a bug or unwanted behaviour

Comments

@Hellseher
Copy link

Hi,

  • Python 3.9
  • Pytest 6.2.5

During packing your project for Guix I've got the warning during check phase:

=============================== warnings summary ===============================
parfive/tests/test_downloader.py::test_async_download[True]
parfive/tests/test_downloader.py::test_download_unique
parfive/tests/test_downloader.py::test_custom_user_agent
  /gnu/store/7frqm5ijy66f81hr8i1j6791k84lds9w-python-pytest-6.2.5/lib/python3.9/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function BaseEventLoop.__del__ at 0x7ffff65cd280>

  Traceback (most recent call last):
    File "/gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9/lib/python3.9/asyncio/base_events.py", line 683, in __del__
      self.close()
    File "/gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9/lib/python3.9/asyncio/unix_events.py", line 61, in close
      self.remove_signal_handler(sig)
    File "/gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9/lib/python3.9/asyncio/unix_events.py", line 150, in remove_signal_handler
      signal.signal(sig, handler)
    File "/gnu/store/65i3nhcwmz0p8rqbg48gaavyky4g4hwk-python-3.9.9/lib/python3.9/signal.py", line 47, in signal
      handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
  ValueError: signal only works in main thread of the main interpreter

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================= 53 passed, 3 warnings in 12.43s ========================
@Cadair
Copy link
Owner

Cadair commented Oct 27, 2022

Hi @Hellseher

Do you have any way I can try and reproduce this? It isn't happening on the CI or my local machine. Is it specific to your build environment or can you reproduce it other ways?

@Cadair Cadair added the bug A report of or a fix for a bug or unwanted behaviour label Oct 27, 2022
@Cadair
Copy link
Owner

Cadair commented Oct 27, 2022

Oh I take that back, it is in the CI, it's just not causing an error: https://github.com/Cadair/parfive/actions/runs/3337872611/jobs/5524783433#step:9:318

I shall have a look into it.

@Hellseher
Copy link
Author

Hi @Hellseher

Do you have any way I can try and reproduce this? It isn't happening on the CI or my local machine. Is it specific to your build environment or can you reproduce it other ways?

Hi @Cadair
You may reproudce it in GNU/Linux Debian distribution or directly using Guix:

Debian

sudo apt-get install guix
guix pull
guix time-machine --commit=93be56a3ab28ed0a482f354b7f536681c99b6999 -- build --no-substitutes --verbosity=5 parfive

Guix

guix pull
guix time-machine --commit=93be56a3ab28ed0a482f354b7f536681c99b6999 -- build --no-substitutes --verbosity=5 parfive

Current version and inputs

guix show parfive

name: parfive
version: 2.0.1
...
systems: x86_64-linux
dependencies: python-aiofiles@0.6.0 python-aioftp@0.21.4 python-aiohttp@3.8.1 python-pytest-asyncio@0.17.2 python-pytest-cov@3.0.0 python-pytest-localserver@0.5.0 python-pytest-socket@0.5.1 python-pytest@6.2.5 python-setuptools-scm@6.3.2 python-tqdm@4.64.1
...

@Cadair
Copy link
Owner

Cadair commented Apr 8, 2024

This is related to #131 I assume, and unfortunately seems to not be mitigated by #133

I really don't know why this happens! 😓

@Hellseher
Copy link
Author

This issue was resolved to switch to pytest@7.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A report of or a fix for a bug or unwanted behaviour
Projects
None yet
Development

No branches or pull requests

2 participants