Reputation: 1877
I am trying this on Ubuntu. So when I run PyTest from PyCharm it worked perfectly but when I tried to run the same command I am getting different errors. Surely I am not building my Command correctly.
So here is what it looks like in PyCharm
target = /some_path/test_xxx.py
options= --server ### -s --browser firefox --html=report.html
And below are what I have tried on shell
lab-automation:~/My_Folder$ py.test /<some_path>/test_XXX.py --server ### -s --browser firefox --html=report.html
Traceback (most recent call last):
File "/usr/local/bin/py.test", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/_pytest/config.py", line 48, in main
config.pluginmanager.check_pending()
File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 490, in check_pending
(name, hookimpl.plugin))
_pytest.vendored_packages.pluggy.PluginValidationError: unknown hook 'pytest_html' in plugin <module 'pytest_suites.conftest' from '/<some_path>/conftest.pyc'>
I have also tried this
py.test --server ### -s --browser firefox --html=report.html /<some_path>/test_XXX.py
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: --server --browser firefox
So in this case it looks like its not able read my conftest file
Upvotes: 1
Views: 1534
Reputation: 377
yeah I think PyTest don't have a server argument. probably it`s missing some plugin
you can see the args list by typing
py.test --help
check it out the plugin list https://pytest.org/dev/plugins_index/index.html that you can use.
Upvotes: 1