Skip to content

Can I somehow use multiple "pytest" sections in a single file, or similar? #3072

@Balky79

Description

@Balky79

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: junitxmlrelated to the junitxml builtin plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions