Skip to content

Commit 2cf2fac

Browse files
committed
Add changelog and readme entry. Remove old runner from github actions
1 parent 00ca88d commit 2cf2fac

File tree

3 files changed

+48
-8
lines changed

3 files changed

+48
-8
lines changed

.github/workflows/main.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ jobs:
6464
run: |
6565
pip install -r requirements-test.txt
6666
- name: Test with Python=${{ matrix.python-version }} Loader=${{ matrix.loader }}
67-
# run: |
68-
# python tests/runtests.py ./_json-ld-api/tests -l ${{ matrix.loader }}
69-
# python tests/runtests.py ./_json-ld-framing/tests -l ${{ matrix.loader }}
70-
# python tests/runtests.py ./_normalization/tests -l ${{ matrix.loader }}
7167
run: |
7268
pytest --tests=./specifications/json-ld-api/tests --loader=${{ matrix.loader }}
7369
pytest --tests=./specifications/json-ld-framing/tests --loader=${{ matrix.loader }}

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
- Minimize async related changes to library code in this release.
99
- In sync environment use `asyncio.run`.
1010
- In async environment use background thread.
11-
- The default test manifests or directories now default to the `./specifications`.
11+
- The default test manifests or directories now default to the `./specifications` directory.
12+
- Add ability to run test suites using pytest and make pytest the default way for running (unit)tests.
1213

1314
## 2.0.4 - 2024-02-16
1415

README.rst

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,46 @@ if you do not clone them into the default ``specifications/`` folder, you will
227227
need to provide the paths to the test runner as arguments when running the
228228
tests, as explained below
229229

230-
Running the tests
231-
####################
230+
Running the sample test suites and unittests using pytest
231+
#########################################################
232232

233233
If the suites repositories are available in the `specifications/` folder of the
234-
PyLD source directory, then all the tests can be run with the following:
234+
PyLD source directory, then all unittests, including the sample test suites,
235+
can be run with pytest_:
236+
237+
.. code-block:: bash
238+
239+
pytest
240+
241+
If you wish to store the test suites in a different location than the default
242+
``specifications/`` folder, or you want to test individual manifest ``.jsonld``
243+
files or directories containing a ``manifest.jsonld``, then you can supply
244+
these files or directories as arguments:
245+
246+
.. code-block:: bash
247+
248+
# use: pytest --tests=TEST_PATH [--tests=TEST_PATH...]
249+
pytest --tests=./specifications/json-ld-api/tests
250+
251+
The test runner supports different document loaders by setting
252+
``--loader requests`` or ``--loader aiohttp``. The default document loader is
253+
set to Requests_.
254+
255+
.. code-block:: bash
256+
257+
pytest --loader=requests --tests=./specifications/json-ld-api/tests
258+
259+
An EARL report can be generated using the ``--earl`` option.
260+
261+
.. code-block:: bash
262+
263+
pytest --earl=./earl-report.json
264+
265+
Running the sample test suites using the original test runner
266+
#############################################################
267+
268+
You can also run the JSON-LD test suites using the original test runner script
269+
provided:
235270

236271
.. code-block:: bash
237272
@@ -249,8 +284,16 @@ these files or directories as arguments:
249284
The test runner supports different document loaders by setting ``-l requests``
250285
or ``-l aiohttp``. The default document loader is set to Requests_.
251286

287+
.. code-block:: bash
288+
289+
python tests/runtests.py -l requests ./specifications/json-ld-api/tests
290+
252291
An EARL report can be generated using the ``-e`` or ``--earl`` option.
253292

293+
.. code-block:: bash
294+
295+
python tests/runtests.py -e ./earl-report.json
296+
254297
255298
.. _Digital Bazaar: https://digitalbazaar.com/
256299

0 commit comments

Comments
 (0)