Closed cornzyblack closed 4 years ago
You can also use the plugin when invoking pytest.main() directly from code:
pytest.main()
import pytest from pytest_jsonreport.plugin import JSONReport plugin = JSONReport() pytest.main(['test_foo.py'], plugins=[plugin])
The above creates a default .report.json file which may not be expected.
To prevent the default .report.json file from being created, an optional argument can be passed, as shown in the following example:
import pytest from pytest_jsonreport.plugin import JSONReport plugin = JSONReport() pytest.main(['--json-report-file=none', 'test_foo.py'], plugins=[plugin])
Agree that this should be in the example, thanks!
Direct invocation
You can also use the plugin when invoking
pytest.main()
directly from code:The above creates a default .report.json file which may not be expected.
To prevent the default .report.json file from being created, an optional argument can be passed, as shown in the following example: