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
Built Distribution
Hashes for sphinx_test_cases-0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd5df70f0f8f729853bade6cd5d55c13b5a40cd4a1265f8ac610e8b713a844ae |
|
MD5 | 923e5b62bc714c58002fefbfe7eeaba3 |
|
BLAKE2b-256 | 80f176a81df023e1cd9b481b5ed4e96d157a1fb66fa18b002da9e3926a865f22 |