Skip to main content

This package is a simple extention to the Sphinx, which is

Project description

Auto description of tests

This package is a simple extention to the Sphinx, which is dedicated to describe test cases. Includes also a directives to autogenerated from the python function description

Allow to create description in reStructuredText, as well as docstring attached to the pytest (currently only sole function, which name begins with test_).

Thanks

Based on the two examples from the sphinx documentation:

  • recipies
  • intenum

Instalation

Standard instalation by pip:

pip install sphinx_test_cases

Source code

The source code is accessable on the github page (including two sample usage):

git clone https://github.com/ArtUrim/sphinx-test

Usage

There is one directive and several field

Directive

.. test:test:: *test_name*

Usage: fields

  • suite -- list (comma separated) of the test suite, to which the tests belongs
  • reqs -- list (comma separated) of the requirements covered by the test
  • init -- initial conditions (could be more then one). Shows in final doc as a enumerated list
  • step -- step to do/verify. In final doc, the enumerated list will covert to the enumerated list (same sequence as occured in the source text file)
  • pass -- group of pass/fail execution criteria. In case of multiple occurence in the input file, each of them must be labelled

Autodoc

Same as above. Autogenerated are

  • test name -- same as a name of the function, but initial test_ trunkated
  • suite -- autogenerated from the list of the mark decorators of the test function

Indicies

There are three indicies generated

 * :ref:`test-requirement`
 * :ref:`test-test`
 * :ref:`test-suite`

Namely:

  • list of the requirements covered by at least one test cases (reqs field)
  • alphabetical list of the test cases
  • list of suites covered by any test cases (suite field)

The requirements and suite prresents list of the references to the test cases which mentioned the requirement or suite.

Example

The source code repository includes two simple example:

  • standalone -- the test description in the reStructuredText
  • docstring -- test case as a function repr

containerization (outdates)

Preffered to use python venv

The examples could be executed using the docker container build by the Dockerfile from docker directory. On the docker hub, you can find the image

docker pull arturim13/sphinx-testdec:01

Build image

Execute in main repository directory (same as this README.md file)

docker build -t arturim/sphinx-testdec -f docker/Dockerfile .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_test_cases-0.5.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_test_cases-0.5-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_test_cases-0.5.tar.gz.

File metadata

  • Download URL: sphinx_test_cases-0.5.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for sphinx_test_cases-0.5.tar.gz
Algorithm Hash digest
SHA256 fd6946e13c121d3ed0f33efcd58e42507396472b7161d5ac59270440c98fe1c6
MD5 4ded23d0a15e77bac37af917ebd3aefa
BLAKE2b-256 cf6930e23bc518af262887dfe2ff701e8fa14a95a9d71d681459675951b60bce

See more details on using hashes here.

File details

Details for the file sphinx_test_cases-0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_test_cases-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 dd5df70f0f8f729853bade6cd5d55c13b5a40cd4a1265f8ac610e8b713a844ae
MD5 923e5b62bc714c58002fefbfe7eeaba3
BLAKE2b-256 80f176a81df023e1cd9b481b5ed4e96d157a1fb66fa18b002da9e3926a865f22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page