Error (long traceback) when running pytest and psutil

Viewed 45

Minimal reproducible example:

File should be named test_something.py

import psutil
import xlwings

def test() -> None:
    wb = xlwings.Book("Book1.xlsm")  # it's an empty .xlsm file that you can create yourself
    sheet_results = wb.sheets("Sheet1")
    sheet_results.api.Copy(None, After=sheet_results.api)

    assert 1 == 1

    wb.close()
    for proc in psutil.process_iter():
        if proc.name() == "EXCEL.EXE":
            proc.kill()

Then go to the terminal and run pytest.

The following error appears:

unit_tests\test_eplet_conversion.py Windows fatal exception: code 0x800706be

Current thread 0x000046cc (most recent call first):
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests\test_eplet_conversion.py", line 27 in test_eplet_conversion
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 192 in pytest_pyfunc_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 1761 in runtest
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 166 in pytest_runtest_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 259 in <lambda>
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 338 in from_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 258 in call_runtest_hook
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 219 in call_and_report
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 130 in runtestprotocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 111 in pytest_runtest_protocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 347 in pytest_runtestloop
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 322 in _main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 268 in wrap_session
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 315 in pytest_cmdline_main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\config\__init__.py", line 164 in main
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests.py", line 3 in <module>
Windows fatal exception: code 0x800706ba

Current thread 0x000046cc (most recent call first):
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests\test_eplet_conversion.py", line 27 in test_eplet_conversion
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 192 in pytest_pyfunc_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 1761 in runtest
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 166 in pytest_runtest_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 259 in <lambda>
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 338 in from_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 258 in call_runtest_hook
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 219 in call_and_report
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 130 in runtestprotocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 111 in pytest_runtest_protocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 347 in pytest_runtestloop
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 322 in _main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 268 in wrap_session
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 315 in pytest_cmdline_main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\config\__init__.py", line 164 in main
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests.py", line 3 in <module>
Windows fatal exception: code 0x800706ba

Current thread 0x000046cc (most recent call first):
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests\test_eplet_conversion.py", line 27 in test_eplet_conversion
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 192 in pytest_pyfunc_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 1761 in runtest
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 166 in pytest_runtest_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 259 in <lambda>
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 338 in from_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 258 in call_runtest_hook
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 219 in call_and_report
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 130 in runtestprotocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 111 in pytest_runtest_protocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 347 in pytest_runtestloop
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 322 in _main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 268 in wrap_session
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 315 in pytest_cmdline_main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\config\__init__.py", line 164 in main
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests.py", line 3 in <module>
Windows fatal exception: code 0x800706ba

Current thread 0x000046cc (most recent call first):
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 192 in pytest_pyfunc_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 1761 in runtest
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 166 in pytest_runtest_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 259 in <lambda>
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 338 in from_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 258 in call_runtest_hook
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 219 in call_and_report
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 130 in runtestprotocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 111 in pytest_runtest_protocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 347 in pytest_runtestloop
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 322 in _main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 268 in wrap_session
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 315 in pytest_cmdline_main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\config\__init__.py", line 164 in main
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests.py", line 3 in <module>
Windows fatal exception: code 0x800706ba

Current thread 0x000046cc (most recent call first):
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 192 in pytest_pyfunc_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\python.py", line 1761 in runtest
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 166 in pytest_runtest_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 259 in <lambda>
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 338 in from_call
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 258 in call_runtest_hook
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 219 in call_and_report
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 130 in runtestprotocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\runner.py", line 111 in pytest_runtest_protocol
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 347 in pytest_runtestloop
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 322 in _main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 268 in wrap_session
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 315 in pytest_cmdline_main
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39 in _multicall
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80 in _hookexec
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265 in __call__
  File "C:\Users\lhott\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\config\__init__.py", line 164 in main
  File "C:\Users\lhott\Documents\Formation scolaire\These\Travail\SagaGL\SAgA\SAgA 1.00\src\viewers\BasicAntibodyAnalysisViewer\unit_tests.py", line 3 in <module>

I'm using Python 3.10.2 and psutil==5.9.2.

0 Answers
Related