我有一个通过pytest考试的考试。我还有一个相邻的源代码,它是一个控制台应用程序(不是pytest),它使用与ModuleNotFoundError相同的函数调用相同的函数。/mytest_outside_pytest.py File "test/mytest_outside_pytest.py",line 1, in <module>
from mylib.mylib
但这会产生一个ModuleNotFoundError:>E ModuleNotFoundError: No module named 'pudb'>tests/mytest.py:130: ModuleNotFoundError
> ERROR: InvocationError for command '/Users/me/myproject/.tox/py3/bi
我在本地通过pycharm.command pytest抛出以下错误运行pytest for aws glue作业。我的源代码似乎能识别awsglue,不确定为什么pytest会抛出这个错误。from awsglue.utils import getResolvedOptions E ModuleNotFoundError:没有名为'awsglue‘的模块
我刚刚发现vscode能够直接从编辑器中运行pytest。这真是太棒了--如果它能工作的话。 目前我在一个虚拟环境中的项目中工作,它在vscode中被正确配置(并被激活)。pytest安装在虚拟环境中,并且也被激活,我编写的测试如预期那样被发现。但每当我运行测试时,它都会说找不到我当前正在处理的模块,并引发一个ModuleNotFoundError。如果仅为工作区和/或用户启用pytest,则没有区别。输出: E ModuleNotFoundError: No module name
/xxxx/xxxx/Library/Application Support/JetBrains/IdeaIC2021.1/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py", line 2, in <module>ModuleNotFoundError: No module named 'pyt