numirias / pytest-json-report

🗒️ A pytest plugin to report test results as JSON
MIT License
146 stars 39 forks source link

Collect all tests #13

Closed Formartha closed 5 years ago

Formartha commented 6 years ago

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 :)

rmcgregor1990 commented 6 years ago

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

Formartha commented 6 years ago

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

numirias commented 6 years ago

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?

Formartha commented 6 years ago

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.

numirias commented 6 years ago

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

numirias commented 5 years ago

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