Skip to content

Commit 8c6a9f5

Browse files
committed
Add changelog and readme entry. Remove old runner from github actions
1 parent c221bfe commit 8c6a9f5

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
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+
- Add ability to run test suites using pytest and make pytest the default way for running (unit)tests.
1112

1213
## 2.0.4 - 2024-02-16
1314

README.rst

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,41 @@ Note that you can clone these repositories into any location you wish; however,
220220
if you do not clone them into the default ``specifications/`` folder, you will
221221
need to provide the paths to the test runner as arguments when running the tests, as explained below
222222

223-
## Running the tests
223+
## Running the sample test suites and unittests using pytest
224224

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

228259
.. code-block:: bash
229260
@@ -241,8 +272,16 @@ directories as arguments:
241272
The test runner supports different document loaders by setting ``-l requests``
242273
or ``-l aiohttp``. The default document loader is set to Requests_.
243274

275+
.. code-block:: bash
276+
277+
python tests/runtests.py -l requests ./specifications/json-ld-api/tests
278+
244279
An EARL report can be generated using the ``-e`` or ``--earl`` option.
245280

281+
.. code-block:: bash
282+
283+
python tests/runtests.py -e ./earl-report.json
284+
246285
247286
.. _Digital Bazaar: https://digitalbazaar.com/
248287

0 commit comments

Comments
 (0)