allure-framework / allure-python

Allure integrations for Python test frameworks
https://allurereport.org/
Apache License 2.0
719 stars 235 forks source link

Ignore --clean-alluredir when using --collectonly #753

Closed ShurikMen closed 8 months ago

ShurikMen commented 1 year ago

Context

When displaying a list of tests with the --collectonly key, the last test execution result is cleared. To prevent the result from being lost, added ignoring cleaning (--clean-alluredir) if there is a key to only output the list of tests ( --collectonly).

Checklist

skhomuti commented 1 year ago

Good idea! Also, it makes sense for all args that don't cause test running. --setup-plan for example. Need to find a way to check it properly. Maybe pytest give it somewhere in params or args

ShurikMen commented 1 year ago

Good idea! Also, it makes sense for all args that don't cause test running. --setup-plan for example. Need to find a way to check it properly. Maybe pytest give it somewhere in params or args

For --setup-plan, the situation is a little different, because if with --coollect-only tests are not run at all (immediately exiting pytest_runtestloop without starting pytest_runtest_protocol), then with --setup-plan tests are run in --setup-only mode. All tests are "executed" without full execution. Allure makes a full report on this execution. Well, --setup-plan remains useful when you need to see how the report will look like without running tests.

alexterent commented 8 months ago

And what about --co ? Will it work?

skhomuti commented 8 months ago

@delatrie could you look at this PR pls?

ShurikMen commented 8 months ago

It would be nice to have tests though.

@delatrie done

delatrie commented 8 months ago

Great, thanks! Extra kudos for increasing test coverage!