Hi,
I'm having a specific project that requires a couple (10) different junit reports.
I can call 10 different calls like this:
py.test --junitxml test_json.xml FileDownloaderTestSuite.py -k MyTestGetJson
py.test --junitxml test_xml.xml FileDownloaderTestSuite.py -k MyTestGetXML
...
Which works fine, but for the simplicity and efficiency on Jenkins, I'd like to use pytest.ini.
So I tried:
[pytest]
addopts =
-k MyTestGetJson
--junitxml=test_json.xml
Which works, but now if I add next "[pytest]" section, or multiple -k values it breaks.
not sure if there's a simple way to resolve this usin pytest.ini, or should I default to bash script?
GitMate.io thinks the contributors most likely able to help are @nicoddemus, and @RonnyPfannschmidt.
You should use different ini files and specify it on command line like this:
py.test -c MyTestGetJson.ini
py.test -c MyTestGetXML.ini
-c file load configuration from
fileinstead of trying to
locate one of the implicit configuration files.
You might also want to look into tox as an easy way to have different pytest invocations both locally and on enkins.
Most helpful comment
You should use different ini files and specify it on command line like this: