32
32
33
33
Install ``pytest-reportlog `` as a test requirement in your test environment.
34
34
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.
36
36
37
37
Each line of the report log contains a self contained JSON object corresponding to a testing event,
38
38
such as a collection or a test result report. The file is guaranteed to be flushed after writing
@@ -64,7 +64,7 @@ Consider this file:
64
64
65
65
::
66
66
67
- $ pytest test_report_example.py -q --report-log=log.json
67
+ $ pytest test_report_example.py -q --report-log=log.jsonl
68
68
.F [100%]
69
69
================================= FAILURES =================================
70
70
________________________________ test_fail _________________________________
@@ -77,11 +77,11 @@ Consider this file:
77
77
------------------- generated report log file: log.json --------------------
78
78
1 failed, 1 passed in 0.12s
79
79
80
- The generated ``log.json `` will contain a JSON object per line:
80
+ The generated ``log.jsonl `` will contain a JSON object per line:
81
81
82
82
::
83
83
84
- $ cat log.json
84
+ $ cat log.jsonl
85
85
{"pytest_version": "5.2.2", "$report_type": "SessionStart"}
86
86
{"nodeid": "", "outcome": "passed", "longrepr": null, "result": null, "sections": [], "$report_type": "CollectReport"}
87
87
{"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
113
113
114
114
Note that this nested list construct is just the JSON representation
115
115
of 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