Pytest segfaults on MacOS

Hi,

when I run unit tests, after a certain time, pytest segfaults. This is an example:

python -m  pytest --cov=src --cov-config=.coveragerc
=================================================================================== test session starts ====================================================================================
platform darwin -- Python 3.12.2, pytest-8.2.0, pluggy-1.5.0
rootdir: /Users/guidoflohr/python/anki-chess-opening-trainer
configfile: .pytest.ini
testpaths: tests
plugins: cov-5.0.0
collected 1 item                                                                                                                                                                           

tests/test_update.py Fatal Python error: Segmentation fault

Current thread 0x00007ff847db5fc0 (most recent call first):
  File "/Users/guidoflohr/python/anki-chess-opening-trainer/src/__init__.py", line 46 in add_menu_item
  File "/Users/guidoflohr/python/anki-chess-opening-trainer/src/__init__.py", line 56 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "<frozen importlib._bootstrap>", line 1387 in _gcd_import
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/importlib/__init__.py", line 90 in import_module
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/pkgutil.py", line 513 in resolve_name
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/unittest/mock.py", line 1439 in __enter__
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/contextlib.py", line 526 in enter_context
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/unittest/mock.py", line 1366 in decoration_helper
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/contextlib.py", line 137 in __enter__
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/unittest/mock.py", line 1384 in patched
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/unittest/case.py", line 589 in _callTestMethod
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/unittest/case.py", line 634 in run
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/unittest/case.py", line 690 in __call__
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/unittest.py", line 343 in runtest
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/runner.py", line 173 in pytest_runtest_call
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/runner.py", line 241 in <lambda>
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/runner.py", line 341 in from_call
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/runner.py", line 240 in call_and_report
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/runner.py", line 135 in runtestprotocol
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/runner.py", line 116 in pytest_runtest_protocol
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/main.py", line 364 in pytest_runtestloop
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/main.py", line 339 in _main
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/main.py", line 285 in wrap_session
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/main.py", line 332 in pytest_cmdline_main
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_callers.py", line 103 in _multicall
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_manager.py", line 120 in _hookexec
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pluggy/_hooks.py", line 513 in __call__
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/config/__init__.py", line 178 in main
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/_pytest/config/__init__.py", line 206 in console_main
  File "/Users/guidoflohr/.pyenv/versions/3.12.2/lib/python3.12/site-packages/pytest/__main__.py", line 7 in <module>
  File "<frozen runpy>", line 88 in _run_code
  File "<frozen runpy>", line 198 in _run_module_as_main

Extension modules: google._upb._message, charset_normalizer.md, PyQt6.QtCore, PyQt6.QtGui, PyQt6.QtNetwork, PyQt6.QtQml, PyQt6.QtQuick, PyQt6.QtWebChannel, PyQt6.QtWebEngineCore, PyQt6.QtWidgets, PyQt6.QtPrintSupport, PyQt6.QtWebEngineWidgets, markupsafe._speedups (total: 13)
make: *** [test] Segmentation fault: 11

Has anybody experienced something similar?

I have already deleted and reinstalled aqt and all the PyQt6 stuff but at no avail.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.