Skip to content

Commit 10b4a40

Browse files
Document that we use JSON lines format (#33)
Fix #16 --------- Co-authored-by: Bruno Oliveira <[email protected]>
1 parent 28a9636 commit 10b4a40

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
next (tbd)
2+
-------------------
3+
4+
* `#16 <https://github.com/pytest-dev/pytest-reportlog/issues/15>`_: switch recommended file extension to `jsonl <https://jsonlines.org/>`__.
5+
6+
17
0.3.0 (2023-04-26)
28
------------------
39

README.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Usage
3232

3333
Install ``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

3737
Each line of the report log contains a self contained JSON object corresponding to a testing event,
3838
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:
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

114114
Note that this nested list construct is just the JSON representation
115115
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

Comments
 (0)