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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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