Examples ======== .. contents:: Contents :local: Importing --------- pytests ....... pytest junit file ~~~~~~~~~~~~~~~~~ .. literalinclude:: ../../tests/doc_test/utils/pytest_data.xml Autogenerated documentation ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: rst .. test-file:: Pytest Test File :id: PYTEST01 :tags: pytest, example :file: ../tests/doc_test/utils/pytest_data.xml :auto_suites: :auto_cases: .. test-file:: Pytest Test File :id: PYTEST01 :tags: pytest, example :file: ../tests/doc_test/utils/pytest_data.xml :auto_suites: :auto_cases: nosetests ......... nosetests junit file ~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: ../../tests/doc_test/utils/nose_data.xml Autogenerated documentation ~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: rst .. test-file:: Nosetests Test File :id: NOSE01 :tags: nose, example :file: ../tests/doc_test/utils/nose_data.xml :auto_suites: :auto_cases: .. test-file:: Nosetests Test File :id: NOSE01 :tags: nose, example :file: ../tests/doc_test/utils/nose_data.xml :auto_suites: :auto_cases: Filtering --------- Tables ...... Tags must include pytest ~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: rst .. needtable:: :tags: pytest :columns: id, title, result, time, tags .. needtable:: :tags: pytest :columns: id, title, result, time, tags Must be defined on this page ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This checks if the filtered needs (test-files, test-suites, test-cases) got defined inside a section called "Importing". .. code-block:: rst .. needtable:: :filter: 'Importing' in sections :columns: id, title, result, time, tags .. needtable:: :filter: 'Importing' in sections :columns: id, title, result, time, tags :style_row: tr_[[copy('result')]] Flows ..... Related to specific id ~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: rst .. needflow:: :filter: id == 'PYTEST01' or 'PYTEST01' in links .. needflow:: :filter: id == 'PYTEST01' or 'PYTEST01' in links All test-files and suites ~~~~~~~~~~~~~~~~~~~~~~~~~ This shows all testfiles and testsuites, which are defined somewhere in the overall documentation. Please note to search for ``testfile`` and ``testsuite`` (no "-" ), as this are the names of the need-objects Sphinx-Test-Reports creates when using the directives ``test-file`` or ``test-suite``. .. code-block:: rst .. needflow:: :types: testfile, testsuite :filter: 'Examples' in sections .. needflow:: :types: testfile, testsuite :filter: 'Examples' in sections Test framework related examples ------------------------------- .. toctree:: :maxdepth: 1 pytest.rst casperjs.rst