Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pytest - Windows fatal exception: code 0x8001010d

I am trying to run a GUI test using pytest and pywinauto. When I run the code normally, it does not complain.

However, when I am doing it via pytest, it throws a bunch of errors:

Windows fatal exception: code 0x8001010d

Note that the code still executes without problems and the cases are marked as passed. It is just that the output is polluted with these weird Windows exceptions.

What is the reason for this. Should I be concerned?

def test_01():
    app = Application(backend='uia')
    app.start(PATH_TO_MY_APP)
    main = app.window(title_re="MY_APP")
    main.wait('visible', timeout=8) # error occurs here
    time.sleep(0.5)
    win_title = f"MY_APP - New Project"
    assert win_title.upper() == main.texts()[0].upper() # error occurs here
like image 722
Joe Avatar asked Aug 16 '19 11:08

Joe


Video Answer


2 Answers

This is an effect of a change introduced with pytest 5.0.0. From the release notes:

#5440: The faulthandler standard library module is now enabled by default to help users diagnose crashes in C modules.

This functionality was provided by integrating the external pytest-faulthandler plugin into the core, so users should remove that plugin from their requirements if used.

For more information see the docs: https://docs.pytest.org/en/stable/usage.html#fault-handler

You can mute these errors as follows:

pytest -p no:faulthandler
like image 140
Felix Zumstein Avatar answered Sep 21 '22 10:09

Felix Zumstein


I had the same problem with Python 3.7.7 32-bit and pytest 5.x.x. It was solved by downgrading pytest to v.4.0.0:

python -m pip install pytest==4.0

Perhaps all Python versions are not compatible with the newest pytest version(s).

like image 39
np8 Avatar answered Sep 23 '22 10:09

np8