numirias / pytest-json-report

🗒️ A pytest plugin to report test results as JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Collect all tests

Formartha opened this issue · comments

Hi,
It seems like I found the plugin I was looking for - however I just wanted to know if there is an ability to dry-run it to collect all the test in a given directory?

if so, please let me know how to do it :)

I think you might be looking for the pytest --collect-only flag.
https://docs.pytest.org/en/latest/example/pythoncollection.html

Yeah, that's the case.
However, I wanted to export it as a json file.
Thought this could do it as well :)

If you run pytest --json-report --collect-only, the collected nodes will still appear in the JSON report. As documented, they will appear under the collectors key.

Is this what you're looking for?

That might seem nice.
However, I think I need to build some json tree even if the modules od teats are shut-down and not working.

Could you give an example of a test suite where you don't get the JSON you need? (And what information you'd expect?)

Closing for now. Feel free to reopen if you want to follow up on that.