Ошибка INTERNAL ERROR при прохождении теста

При запуске теста в Pycharm возникает ошибка

Launching pytest with arguments D:/repositories/edispa-cloudborn/emergency/tests/test_14_edispa_emergency_300_norm.py --no-header --no-summary -q in D:\repositories\edispa-cloudborn\emergency\tests

============================= test session starts =============================
collecting ... collected 1 item

test_14_edispa_emergency_300_norm.py::test_14_edispa_emergency_300_norm FAILED [100%]
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\_pytest\main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\_pytest\main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\_pytest\main.py", line 348, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\_pytest\runner.py", line 109, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\_pytest\runner.py", line 126, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\_pytest\runner.py", line 219, in call_and_report
INTERNALERROR>     hook.pytest_runtest_logreport(report=report)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "D:\repositories\edispa-cloudborn\.venv\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "D:\PyCharm Professional\plugins\python\helpers\pycharm\teamcity\pytest_plugin.py", line 310, in pytest_runtest_logreport
INTERNALERROR>     self.report_test_failure(test_id, report)
INTERNALERROR>   File "D:\PyCharm Professional\plugins\python\helpers\pycharm\teamcity\pytest_plugin.py", line 260, in report_test_failure
INTERNALERROR>     self.teamcity.testFailed(test_id, diff_error.msg or message, strace,
INTERNALERROR>   File "D:\PyCharm Professional\plugins\python\helpers\pycharm\_jb_runner_tools.py", line 188, in testFailed
INTERNALERROR>     _old_service_messages.testFailed(self, testName, message, details, comparison_failure=comparison_failure)
INTERNALERROR>   File "D:\PyCharm Professional\plugins\python\helpers\pycharm\teamcity\messages.py", line 177, in testFailed
INTERNALERROR>     self.message('testFailed',
INTERNALERROR>   File "D:\PyCharm Professional\plugins\python\helpers\pycharm\_jb_runner_tools.py", line 117, in message
INTERNALERROR>     _old_service_messages.message(self, messageName, **properties)
INTERNALERROR>   File "D:\PyCharm Professional\plugins\python\helpers\pycharm\teamcity\messages.py", line 101, in message
INTERNALERROR>     retry_on_EAGAIN(self.output.write)(self.encode(message))
INTERNALERROR>   File "D:\PyCharm Professional\plugins\python\helpers\pycharm\teamcity\messages.py", line 68, in encode
INTERNALERROR>     value = value.encode(self.encoding)
INTERNALERROR>   File "C:\Users\username\AppData\Local\Programs\Python\Python38\lib\encodings\cp1251.py", line 12, in encode
INTERNALERROR>     return codecs.charmap_encode(input,errors,encoding_table)
INTERNALERROR> UnicodeEncodeError: 'charmap' codec can't encode character '\u2424' in position 54090: character maps to <undefined>

====================== 1 failed, 146 warnings in 11.95s =======================

Сам тест такой:

def test_name_test(snapshot):
    with open(os.path.join(os.path.dirname(__file__), 'name_file.json'), 'r',) as file:
        schema = json.load(file)
    result = respond_to_emergency(schema)
    assert result == snapshot

Причем, если тест прогонять через дебаггер, то он проходит вплоть до выполнения строки с assert, а потом выдается ошибка. Причем если запустить тест в VSC, то все ок. Ошибки нет. Я понимаю что проблема скорее всего в Pycharm, но я не понимаю в чем дело. Система: Windows 11. Тестировщик pytest. Пробовал прописывать encoding='utf8' - не помогло.

Upd: настройки запуска теста в Pycharm введите сюда описание изображения


Ответы (0 шт):