我正在尝试使用 Pycharm py.test 测试运行器运行一些测试,我需要将命令行选项传递给 py.test 插件 ( pytest-beds)。
我尝试将选项添加到测试运行配置中的附加选项字段,但出现以下错误:
Testing started at 9:54 AM ...
/usr/local/bin/python /Applications/PyCharm.app/Contents/helpers/pycharm/_jb_pytest_runner.py -- --sdk-path=/some/other/long/path/google-cloud-sdk/platform/google_appengine tests/test_fixture_handler
Launching py.test with arguments --sdk-path=/some/other/long/path/google-cloud-sdk/platform/google_appengine tests/test_fixture_handler in /some/long/path
usage: _jb_pytest_runner.py [options] [file_or_dir] [file_or_dir] [...]
_jb_pytest_runner.py: error: unrecognized arguments: --sdk-path=/some/other/long/path/google-cloud-sdk/platform/google_appengine
inifile: /some/long/path/pytest.ini
rootdir: /some/long/path
Process finished with exit code 2
Empty test suite.
在 pytest.ini 中添加了采用的选项,但我得到了相同的结果。
最佳答案
基本上与以下相同的问题:PyCharm unable to load NoseGAE . Google 应用引擎包含一个古老的设置工具,它会干扰 py.test 加载插件。
关于python - 使用 Pycharm pytest runner 时如何将插件选项传递给 pytest?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50533848/