3232
3333Install ``pytest-reportlog `` as a test requirement in your test environment.
3434
35- The ``--report-log=FILE `` option writes * report logs * into a file as the test session executes.
35+ The ``--report-log=FILE `` option writes a file in ` JSON lines < https://jsonlines.org/ >`__ format as the test session executes.
3636
3737Each line of the report log contains a self contained JSON object corresponding to a testing event,
3838such as a collection or a test result report. The file is guaranteed to be flushed after writing
@@ -64,7 +64,7 @@ Consider this file:
6464
6565 ::
6666
67- $ pytest test_report_example.py -q --report-log=log.json
67+ $ pytest test_report_example.py -q --report-log=log.jsonl
6868 .F [100%]
6969 ================================= FAILURES =================================
7070 ________________________________ test_fail _________________________________
@@ -77,11 +77,11 @@ Consider this file:
7777 ------------------- generated report log file: log.json --------------------
7878 1 failed, 1 passed in 0.12s
7979
80- The generated ``log.json `` will contain a JSON object per line:
80+ The generated ``log.jsonl `` will contain a JSON object per line:
8181
8282::
8383
84- $ cat log.json
84+ $ cat log.jsonl
8585 {"pytest_version": "5.2.2", "$report_type": "SessionStart"}
8686 {"nodeid": "", "outcome": "passed", "longrepr": null, "result": null, "sections": [], "$report_type": "CollectReport"}
8787 {"nodeid": "test_report_example.py", "outcome": "passed", "longrepr": null, "result": null, "sections": [], "$report_type": "CollectReport"}
@@ -113,11 +113,3 @@ This information will be recorded in the report JSON objects under the ``user_pr
113113
114114Note that this nested list construct is just the JSON representation
115115of a list of tuples (name-value pairs).
116-
117-
118- License
119- =======
120-
121- Distributed under the terms of the `MIT `_ license.
122-
123- .. _MIT : https://github.com/pytest-dev/pytest-mock/blob/master/LICENSE
0 commit comments