我能够直接从IntelliJ运行这个Python测试:
from unittest import TestCase
class TestDebug(TestCase):
def test_debug(self):
print("test")输出:
/Users/work/dev/venv/bin/python3 "/Users/work/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ IDEA.app.plugins/python/helpers/pycharm/_jb_unittest_runner.py" --target test_debug.TestDebug
Testing started at 9:45 AM ...
Launching unittests with arguments python -m unittest test_debug.TestDebug in /Users/work/dev/tests
Ran 1 test in 0.001s
OK
Process finished with exit code 0
test但是,在调试模式下运行它时,该输出会失败:
/Users/work/dev/venv/bin/python3 "/Users/work/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ IDEA.app.plugins/python/helpers/pydev/pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 57545 --file "/Users/work/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ IDEA.app.plugins/python/helpers/pycharm/_jb_unittest_runner.py" --target test_debug.TestDebug
Testing started at 9:45 AM ...
Connected to pydev debugger (build 213.5744.223)
Process finished with exit code 138 (interrupted by signal 10: SIGBUS)
Empty suite
Empty suite任何帮助都是非常感谢的!
发布于 2022-01-01 16:03:32
这似乎是由Cython问题引起的。可以通过在运行/调试配置或环境中设置以下内容来解决此问题:
PYDEVD_USE_CYTHON=NO
PYDEVD_USE_FRAME_EVAL=NOhttps://stackoverflow.com/questions/70543879
复制相似问题