quantum-serverless/client/tests
Iskandar Sitdikov e24c2a2543
Issue 593 | Client: deprecate stop in favor of cancel (#1494)
2024-09-19 16:06:12 -04:00
..
core Issue 593 | Client: deprecate stop in favor of cancel (#1494) 2024-09-19 16:06:12 -04:00
resources update-version-0.16.3 (#1489) 2024-09-11 14:01:33 -04:00
serializers Rename Quantum Serverless to Qiskit Serverless (#1309) 2024-05-07 15:11:03 -04:00
README.md update-version-0.15.0 (#1446) 2024-08-07 12:03:16 -04:00
__init__.py Quantum Serverless initial implementation (#1) 2022-09-19 09:31:56 -04:00
utils.py Rename Quantum Serverless to Qiskit Serverless (#1309) 2024-05-07 15:11:03 -04:00

README.md

Test environments

This repository's tests and development automation tasks are organized using tox, a command-line CI frontend for Python projects. tox is typically used during local development and is also invoked from this repository's GitHub Actions workflows.

tox can be installed by running pip install tox.

tox is organized around various "environments," each of which is described below. To run all test environments, run tox without any arguments:

$ tox

Environments for this repository are configured in tox.ini as described below.

Lint environment

The lint environment ensures that the code meets basic coding standards, including

The Black and mypy passes are applied also to Jupyter notebooks (via nbqa).

To run:

$ tox -elint

If the Black check fails, the Black environment can be invoked to easily reformat all files as necessary.

Black environment

The command tox -eblack will reformat all files in the repository according to Black style.

Test (py##) environments

The py## environments are the main test environments. tox defines one for each version of Python. For instance, the following command will run the tests on Python 3.9 and Python 3.10:

$ tox -epy311

First, these environments execute all tests using pytest, which supports its own simple style of tests, in addition to unittest-style tests and doctests located throughout the project's docstrings.

Second, these environments invoke treon to ensure that all Jupyter notebooks in the docs/ directory execute successfully.

Coverage environment

The coverage environment uses Coverage.py to ensure that the fraction of code tested by pytest is above some threshold (80% at the time of writing).

To run:

$ tox -ecoverage