From fdfde2680b72697d0ee0c00ba571576a3d0aca39 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 14 Oct 2024 00:40:21 +0200 Subject: [PATCH 1/6] Reenable test result publishing. --- .github/workflows/Pipeline.yml | 20 ++++++++++---------- pyEDAA/Reports/__init__.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 7aa5457f..b47c293b 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -165,13 +165,13 @@ jobs: secrets: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} -# PublishTestResults: -# uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev -# needs: -# - UnitTestingParams -# - UnitTesting -# with: -# merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} + PublishTestResults: + uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@dev + needs: + - UnitTestingParams + - UnitTesting + with: + merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} # VerifyDocs: # uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@r1 @@ -184,7 +184,7 @@ jobs: uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@r1 needs: - UnitTestingParams -# - PublishTestResults + - PublishTestResults - PublishCoverageResults # - VerifyDocs with: @@ -199,7 +199,7 @@ jobs: needs: - UnitTestingParams - PublishCoverageResults -# - PublishTestResults + - PublishTestResults - HTMLDocumentation with: sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}- @@ -257,7 +257,7 @@ jobs: - StaticTypeCheck - HTMLDocumentation # - PDFDocumentation -# - PublishTestResults + - PublishTestResults - PublishCoverageResults - PublishToGitHubPages # - PublishOnPyPI diff --git a/pyEDAA/Reports/__init__.py b/pyEDAA/Reports/__init__.py index 24ac9eec..1e17c1a1 100644 --- a/pyEDAA/Reports/__init__.py +++ b/pyEDAA/Reports/__init__.py @@ -35,7 +35,7 @@ __email__ = "Paebbels@gmail.com" __copyright__ = "2021-2024, Electronic Design Automation Abstraction (EDA²)" __license__ = "Apache License, Version 2.0" -__version__ = "0.14.0" +__version__ = "0.14.1" __keywords__ = ["Reports", "Abstract Model", "Data Model", "Unit Testing", "Testcase", "Testsuite", "OSVVM", "YAML", "XML"] from enum import Enum From 02f874d263d73cb160464b5f3ae71f0c1c586eb4 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 14 Oct 2024 01:21:59 +0200 Subject: [PATCH 2/6] Use InheritDocumentation from helper module. --- pyEDAA/Reports/Unittesting/OSVVM.py | 42 +++++++++++++---------------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/pyEDAA/Reports/Unittesting/OSVVM.py b/pyEDAA/Reports/Unittesting/OSVVM.py index 20231d6f..3b978bb8 100644 --- a/pyEDAA/Reports/Unittesting/OSVVM.py +++ b/pyEDAA/Reports/Unittesting/OSVVM.py @@ -41,24 +41,7 @@ from pyEDAA.Reports.Unittesting import TestsuiteSummary as ut_TestsuiteSummary, Testsuite as ut_Testsuite from pyEDAA.Reports.Unittesting import Testcase as ut_Testcase - -from typing import Callable - -@export -def InheritDocumentation(baseClass: type, merge: bool = False) -> Callable[[type], type]: - """xxx""" - def decorator(c: type) -> type: - """yyy""" - if merge: - if c.__doc__ is None: - c.__doc__ = baseClass.__doc__ - elif baseClass.__doc__ is not None: - c.__doc__ = baseClass.__doc__ + "\n\n" + c.__doc__ - else: - c.__doc__ = baseClass.__doc__ - return c - - return decorator +from pyEDAA.Reports.helper import InheritDocumentation @export @@ -125,11 +108,20 @@ def Analyze(self) -> None: @notimplemented def Write(self, path: Nullable[Path] = None, overwrite: bool = False) -> None: + """ + Write the data model as XML into a file adhering to the Any JUnit dialect. + + :param path: Optional path to the YAML file, if internal path shouldn't be used. + :param overwrite: If true, overwrite an existing file. + :raises UnittestException: If the file cannot be overwritten. + :raises UnittestException: If the internal YAML data structure wasn't generated. + :raises UnittestException: If the file cannot be opened or written. + """ if path is None: path = self._path if not overwrite and path.exists(): - raise UnittestException(f"OSVVM YAML file '{path}' can not be written.") \ + raise UnittestException(f"OSVVM YAML file '{path}' can not be overwritten.") \ from FileExistsError(f"File '{path}' already exists.") # if regenerate: @@ -137,7 +129,7 @@ def Write(self, path: Nullable[Path] = None, overwrite: bool = False) -> None: if self._yamlDocument is None: ex = UnittestException(f"Internal YAML document tree is empty and needs to be generated before write is possible.") - ex.add_note(f"Call 'BuildSummaryDocument.Generate()' or 'BuildSummaryDocument.Write(..., regenerate=True)'.") + # ex.add_note(f"Call 'BuildSummaryDocument.Generate()' or 'BuildSummaryDocument.Write(..., regenerate=True)'.") raise ex # with path.open("w", encoding="utf-8") as file: @@ -240,6 +232,8 @@ def Convert(self) -> None: """ Convert the parsed YAML data structure into a test entity hierarchy. + This method converts the root element. + .. hint:: The time spend for model conversion will be made available via property :data:`ModelConversionDuration`. @@ -259,13 +253,13 @@ def Convert(self) -> None: if "TestSuites" in self._yamlDocument: for yamlTestsuite in self._ParseSequenceFromYAML(self._yamlDocument, "TestSuites"): - self._ParseTestsuite(self, yamlTestsuite) + self._ConvertTestsuite(self, yamlTestsuite) self.Aggregate() endConversation = perf_counter_ns() self._modelConversion = (endConversation - startConversion) / 1e9 - def _ParseTestsuite(self, parentTestsuite: Testsuite, yamlTestsuite: CommentedMap) -> None: + def _ConvertTestsuite(self, parentTestsuite: Testsuite, yamlTestsuite: CommentedMap) -> None: testsuiteName = self._ParseStrFieldFromYAML(yamlTestsuite, "Name") totalDuration = self._ParseDurationFieldFromYAML(yamlTestsuite, "ElapsedTime") @@ -277,9 +271,9 @@ def _ParseTestsuite(self, parentTestsuite: Testsuite, yamlTestsuite: CommentedMa # if yamlTestsuite['TestCases'] is not None: for yamlTestcase in self._ParseSequenceFromYAML(yamlTestsuite, 'TestCases'): - self._ParseTestcase(testsuite, yamlTestcase) + self._ConvertTestcase(testsuite, yamlTestcase) - def _ParseTestcase(self, parentTestsuite: Testsuite, yamlTestcase: CommentedMap) -> None: + def _ConvertTestcase(self, parentTestsuite: Testsuite, yamlTestcase: CommentedMap) -> None: testcaseName = self._ParseStrFieldFromYAML(yamlTestcase, "TestCaseName") totalDuration = self._ParseDurationFieldFromYAML(yamlTestcase, "ElapsedTime") yamlStatus = self._ParseStrFieldFromYAML(yamlTestcase, "Status").lower() From 182198b91f013a5d23d01e39094ffedf6ca08025 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 27 Oct 2024 19:49:04 +0100 Subject: [PATCH 3/6] Bumped dependencies. --- doc/Dependency.rst | 8 ++++---- doc/Glossary.rst | 19 +++++++++++++++++++ doc/requirements.txt | 6 +++--- pyproject.toml | 4 ++-- requirements.txt | 2 +- tests/requirements.txt | 2 +- 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/doc/Dependency.rst b/doc/Dependency.rst index 67633825..f5dc4ad9 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -27,7 +27,7 @@ pyEDAA.Reports Package +-----------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=================================================================+=============+===========================================================================================+========================================================================================================================================================+ -| `pyTooling `__ | ≥6.7 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥7.0 | `Apache License, 2.0 `__ | *None* | +-----------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ | `ruamel.yaml `__ | ≥0.18 | `MIT `__ | *Not yet evaluated.* | +-----------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -65,7 +65,7 @@ the mandatory dependencies too. +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `Coverage `__ | ≥7.6 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `mypy `__ | ≥1.11 | `MIT `__ | *Not yet evaluated.* | +| `mypy `__ | ≥1.13 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `typing-extensions `__ | ≥4.12 | `PSF-2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ @@ -97,7 +97,7 @@ the mandatory dependencies too. +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +=================================================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥6.7 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥7.0 | `Apache License, 2.0 `__ | *None* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `Sphinx `__ | ≥8.1 | `BSD 3-Clause `__ | *Not yet evaluated.* | +-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -133,7 +133,7 @@ install the mandatory dependencies too. +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | **Package** | **Version** | **License** | **Dependencies** | +============================================================================+==============+==========================================================================================================+======================================================================================================================================================+ -| `pyTooling `__ | ≥6.7 | `Apache License, 2.0 `__ | *None* | +| `pyTooling `__ | ≥7.0 | `Apache License, 2.0 `__ | *None* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ | `wheel `__ | ≥0.44 | `MIT `__ | *Not yet evaluated.* | +----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/doc/Glossary.rst b/doc/Glossary.rst index e980a9ba..01428295 100644 --- a/doc/Glossary.rst +++ b/doc/Glossary.rst @@ -15,5 +15,24 @@ Glossary Functional Coverage tbd + JUnit + :dfn:`Java Unit Testing` framework. + Test Coverage tbd + + Test Entity + A :dfn:`Test Entity` is an entity in the test entity hierarchy. It can be a :dfn:`Test Case`, :dfn:`Test Suite` or + :dfn:`Test Suite Summary`. Some hierarchies (like JUnit) got extended by a :dfn:`Test Class`. + + Test Case + tbd + + Test Class + tbd + + Test Suite + tbd + + Test Suite Summary + tbd diff --git a/doc/requirements.txt b/doc/requirements.txt index df742831..ddf9b224 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,9 +1,9 @@ -r ../requirements.txt -pyTooling ~= 6.7 +pyTooling ~= 7.0 colorama >= 0.4.6 ruamel.yaml ~= 0.18.6 -setuptools ~= 75.1 +setuptools ~= 75.2 # Enforce latest version on ReadTheDocs sphinx ~= 8.1 @@ -23,6 +23,6 @@ sphinx_design ~= 0.6.1 sphinx-copybutton >= 0.5.2 sphinx_autodoc_typehints ~= 2.5 # changelog>=0.3.5 -sphinx_reports ~= 0.6 +sphinx_reports ~= 0.7 # BuildTheDocs Extensions (mostly patched Sphinx extensions) diff --git a/pyproject.toml b/pyproject.toml index f52d5edc..85fd7d2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ - "setuptools ~= 75.1", + "setuptools ~= 75.2", "wheel ~= 0.44", - "pyTooling ~= 6.7" + "pyTooling ~= 7.0" ] build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index 8d166149..09413de2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pyTooling ~= 6.7 +pyTooling ~= 7.0 ruamel.yaml ~= 0.18.6 lxml ~= 5.3 diff --git a/tests/requirements.txt b/tests/requirements.txt index 77e2f22b..130f5c68 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -8,6 +8,6 @@ pytest ~= 8.3 pytest-cov ~= 5.0 # Static Type Checking -mypy ~= 1.11 +mypy ~= 1.13 typing_extensions ~= 4.12 lxml ~= 5.3 From fefd6ef638177b99762f2a0c11c0d2598be67684 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 15:31:39 +0100 Subject: [PATCH 4/6] Relaxed requirements. --- .github/workflows/Pipeline.yml | 45 ++++++++++++++++++++-------------- .idea/pyEDAA.Reports.iml | 2 +- doc/Dependency.rst | 2 +- doc/requirements.txt | 4 +-- pyproject.toml | 4 +-- requirements.txt | 2 +- tests/requirements.txt | 2 +- 7 files changed, 34 insertions(+), 27 deletions(-) diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index b47c293b..2d7ec2e5 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -84,7 +84,7 @@ jobs: path: examples/Python/pytest/*.xml UnitTestingParams: - uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1 + uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev with: name: pyEDAA.Reports python_version_list: "3.9 3.10 3.11 3.12 pypy-3.9 pypy-3.10" @@ -109,7 +109,7 @@ jobs: coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }} StaticTypeCheck: - uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r1 + uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@dev needs: - UnitTestingParams with: @@ -121,7 +121,7 @@ jobs: html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} DocCoverage: - uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r1 + uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev needs: - UnitTestingParams with: @@ -129,8 +129,13 @@ jobs: directory: pyEDAA/Reports # fail_below: 70 + ConfigParams: + uses: pyTooling/Actions/.github/workflows/ExtractConfiguration.yml@dev + needs: + - DocCoverage + Package: - uses: pyTooling/Actions/.github/workflows/Package.yml@r1 + uses: pyTooling/Actions/.github/workflows/Package.yml@dev needs: - UnitTestingParams - UnitTesting @@ -139,7 +144,7 @@ jobs: artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }} AppTesting: - uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@r1 + uses: pyTooling/Actions/.github/workflows/ApplicationTesting.yml@dev needs: - AppTestingParams - UnitTestingParams @@ -153,7 +158,7 @@ jobs: apptest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).apptesting_xml }} PublishCoverageResults: - uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@r1 + uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@dev needs: - UnitTestingParams - UnitTesting @@ -174,52 +179,54 @@ jobs: merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }} # VerifyDocs: -# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@r1 +# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@dev # needs: # - UnitTestingParams # with: # python_version: ${{ needs.UnitTestingParams.outputs.python_version }} - HTMLDocumentation: - uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@r1 + Documentation: + uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@dev needs: - UnitTestingParams + - ConfigParams - PublishTestResults - PublishCoverageResults # - VerifyDocs with: python_version: ${{ needs.UnitTestingParams.outputs.python_version }} + coverage_report_json_directory: ${{ needs.ConfigParams.outputs.coverage_report_json_directory }} unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-ubuntu-native-3.12 coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }} html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }} latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} IntermediateCleanUp: - uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@r1 + uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@dev needs: - UnitTestingParams - PublishCoverageResults - PublishTestResults - - HTMLDocumentation + - Documentation with: sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}- xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}- # PDFDocumentation: -# uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@r1 +# uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@dev # needs: # - UnitTestingParams -# - HTMLDocumentation +# - Documentation # with: # document: pyEDAA.Reports # latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }} # pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }} PublishToGitHubPages: - uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r1 + uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@dev needs: - UnitTestingParams - - HTMLDocumentation + - Documentation # - PDFDocumentation - PublishCoverageResults - StaticTypeCheck @@ -229,7 +236,7 @@ jobs: typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }} ReleasePage: - uses: pyTooling/Actions/.github/workflows/Release.yml@r1 + uses: pyTooling/Actions/.github/workflows/Release.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - Package @@ -237,7 +244,7 @@ jobs: - PublishToGitHubPages PublishOnPyPI: - uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r1 + uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@dev if: startsWith(github.ref, 'refs/tags') needs: - UnitTestingParams @@ -250,12 +257,12 @@ jobs: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} ArtifactCleanUp: - uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r1 + uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@dev needs: - UnitTestingParams - UnitTesting - StaticTypeCheck - - HTMLDocumentation + - Documentation # - PDFDocumentation - PublishTestResults - PublishCoverageResults diff --git a/.idea/pyEDAA.Reports.iml b/.idea/pyEDAA.Reports.iml index 989330a9..2a4acfe3 100644 --- a/.idea/pyEDAA.Reports.iml +++ b/.idea/pyEDAA.Reports.iml @@ -9,7 +9,7 @@ - + \ No newline at end of file diff --git a/doc/Dependency.rst b/doc/Dependency.rst index f5dc4ad9..4f2f7014 100644 --- a/doc/Dependency.rst +++ b/doc/Dependency.rst @@ -61,7 +61,7 @@ the mandatory dependencies too. +=====================================================================+=============+========================================================================================+======================+ | `pytest `__ | ≥8.3 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ -| `pytest-cov `__ | ≥5.0 | `MIT `__ | *Not yet evaluated.* | +| `pytest-cov `__ | ≥6.0 | `MIT `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ | `Coverage `__ | ≥7.6 | `Apache License, 2.0 `__ | *Not yet evaluated.* | +---------------------------------------------------------------------+-------------+----------------------------------------------------------------------------------------+----------------------+ diff --git a/doc/requirements.txt b/doc/requirements.txt index ddf9b224..2520c898 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,9 +1,9 @@ -r ../requirements.txt -pyTooling ~= 7.0 +#pyTooling ~= 7.0 colorama >= 0.4.6 ruamel.yaml ~= 0.18.6 -setuptools ~= 75.2 +setuptools ~= 75.3 # Enforce latest version on ReadTheDocs sphinx ~= 8.1 diff --git a/pyproject.toml b/pyproject.toml index 85fd7d2c..d3dd7da7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools ~= 75.2", + "setuptools ~= 75.3", "wheel ~= 0.44", "pyTooling ~= 7.0" ] @@ -11,7 +11,7 @@ line-length = 120 [tool.mypy] files = ["pyEDAA.Reports"] -python_version = "3.12" +python_version = "3.13" #ignore_missing_imports = true strict = true pretty = true diff --git a/requirements.txt b/requirements.txt index 09413de2..9bbd5a0d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pyTooling ~= 7.0 +pyTooling >= 6.7, <8.0 ruamel.yaml ~= 0.18.6 lxml ~= 5.3 diff --git a/tests/requirements.txt b/tests/requirements.txt index 130f5c68..2ad659b6 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -5,7 +5,7 @@ Coverage ~= 7.6 # Test Runner pytest ~= 8.3 -pytest-cov ~= 5.0 +pytest-cov ~= 6.0 # Static Type Checking mypy ~= 1.13 From 3f8662265bad4d6fc8813e29a598b6fcd7b7fad1 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 17:20:46 +0100 Subject: [PATCH 5/6] Added tests for outputs produced by GitHub. --- doc/requirements.txt | 5 - tests/app/GitHub/Examples.py | 268 ++++++++++++++++++++++++++++++++++- 2 files changed, 264 insertions(+), 9 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 2520c898..e48a3387 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,10 +1,5 @@ -r ../requirements.txt -#pyTooling ~= 7.0 -colorama >= 0.4.6 -ruamel.yaml ~= 0.18.6 -setuptools ~= 75.3 - # Enforce latest version on ReadTheDocs sphinx ~= 8.1 docutils ~= 0.21 diff --git a/tests/app/GitHub/Examples.py b/tests/app/GitHub/Examples.py index 89642d03..46ed7f99 100644 --- a/tests/app/GitHub/Examples.py +++ b/tests/app/GitHub/Examples.py @@ -29,8 +29,16 @@ # ==================================================================================================================== # # """Testcase for application testing report files generated on GitHub.""" -from pathlib import Path -from unittest import TestCase +from pathlib import Path +from unittest import TestCase + +from pyTooling.Common import zipdicts + +# FIXME: change to generic JUnit +from pyEDAA.Reports.Unittesting.JUnit.AntJUnit4 import Document as JUnit4Document +from pyEDAA.Reports.Unittesting.JUnit.CTestJUnit import Document as CTestDocument +from pyEDAA.Reports.Unittesting.JUnit.GoogleTestJUnit import Document as GTestDocument +from pyEDAA.Reports.Unittesting.JUnit.PyTestJUnit import Document as PyTestDocument if __name__ == "__main__": # pragma: no cover @@ -39,6 +47,258 @@ exit(1) -class Dummy(TestCase): - def test_dummy(self): +class CppGoogleTest(TestCase): + def test_gtest(self): + print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Cpp-GoogleTest/gtest.xml") + doc = GTestDocument(junitExampleFile, analyzeAndConvert=True) + + self.assertEqual(1, doc.TestsuiteCount) + self.assertEqual(3, doc.TestcaseCount) + + print(f"JUnit file:") + print(f" Testsuites: {doc.TestsuiteCount}") + print(f" Testcases: {doc.TestcaseCount}") + + print() + print(f"Statistics:") + print(f" Times: parsing by lxml: {doc.AnalysisDuration.total_seconds():.3f}s convert: {doc.ModelConversionDuration.total_seconds():.3f}s") + + def test_ReadWrite(self): + print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Cpp-GoogleTest/gtest.xml") + doc = GTestDocument(junitExampleFile, analyzeAndConvert=True) + + junitOutputFile = Path("tests/output/JUnit/pyEDAA.Reports/Cpp-GoogleTest/gtest.xml") + junitOutputFile.parent.mkdir(parents=True, exist_ok=True) + doc.Write(junitOutputFile, regenerate=True, overwrite=True) + + sameDoc = GTestDocument(junitOutputFile, analyzeAndConvert=True) + + self.assertEqual(doc.TestsuiteCount, sameDoc.TestsuiteCount) + self.assertEqual(doc.TestcaseCount, sameDoc.TestcaseCount) + self.assertEqual(doc.Errored, sameDoc.Errored) + self.assertEqual(doc.Skipped, sameDoc.Skipped) + self.assertEqual(doc.Failed, sameDoc.Failed) + self.assertEqual(doc.Passed, sameDoc.Passed) + self.assertEqual(doc.Tests, sameDoc.Tests) + + for tsName, ts, sameTS in zipdicts(doc._testsuites, sameDoc._testsuites): + self.assertEqual(ts.Name, sameTS.Name) + self.assertEqual(ts.Duration, sameTS.Duration) + self.assertEqual(ts.TestcaseCount, sameTS.TestcaseCount) + self.assertEqual(ts.AssertionCount, sameTS.AssertionCount) + self.assertEqual(ts.Errored, sameTS.Errored) + self.assertEqual(ts.Skipped, sameTS.Skipped) + self.assertEqual(ts.Failed, sameTS.Failed) + self.assertEqual(ts.Passed, sameTS.Passed) + self.assertEqual(ts.Tests, sameTS.Tests) + + for tclsName, tcls, sameTCls in zipdicts(ts._testclasses, sameTS._testclasses): + self.assertEqual(tcls.Name, sameTCls.Name) + self.assertEqual(tcls.Classname, sameTCls.Classname) + self.assertEqual(tcls.TestcaseCount, sameTCls.TestcaseCount) + self.assertEqual(tcls.AssertionCount, sameTCls.AssertionCount) + + for tcName, tc, sameTC in zipdicts(tcls._testcases, sameTCls._testcases): + self.assertEqual(tc.Name, sameTC.Name) + self.assertEqual(tc.Classname, sameTC.Classname) + self.assertEqual(tc.Status, sameTC.Status) + self.assertEqual(tc.Duration, sameTC.Duration) + self.assertEqual(tc.AssertionCount, sameTC.AssertionCount) + + +class CppGoogleTestCTest(TestCase): + def test_ctest(self): + print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Cpp-GoogleTest/ctest.xml") + doc = CTestDocument(junitExampleFile, analyzeAndConvert=True) + + # self.assertEqual(1, doc.TestsuiteCount) + # self.assertEqual(3, doc.TestcaseCount) + + print(f"JUnit file:") + print(f" Testsuites: {doc.TestsuiteCount}") + print(f" Testcases: {doc.TestcaseCount}") + + print() + print(f"Statistics:") + print(f" Times: parsing by lxml: {doc.AnalysisDuration.total_seconds():.3f}s convert: {doc.ModelConversionDuration.total_seconds():.3f}s") + + def test_ReadWrite(self): print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Cpp-GoogleTest/ctest.xml") + doc = CTestDocument(junitExampleFile, analyzeAndConvert=True) + + junitOutputFile = Path("tests/output/JUnit/pyEDAA.Reports/Cpp-GoogleTest/ctest.xml") + junitOutputFile.parent.mkdir(parents=True, exist_ok=True) + doc.Write(junitOutputFile, regenerate=True, overwrite=True) + + sameDoc = CTestDocument(junitOutputFile, analyzeAndConvert=True) + + self.assertEqual(doc.TestsuiteCount, sameDoc.TestsuiteCount) + self.assertEqual(doc.TestcaseCount, sameDoc.TestcaseCount) + self.assertEqual(doc.Errored, sameDoc.Errored) + self.assertEqual(doc.Skipped, sameDoc.Skipped) + self.assertEqual(doc.Failed, sameDoc.Failed) + self.assertEqual(doc.Passed, sameDoc.Passed) + self.assertEqual(doc.Tests, sameDoc.Tests) + + for tsName, ts, sameTS in zipdicts(doc._testsuites, sameDoc._testsuites): + self.assertEqual(ts.Name, sameTS.Name) + self.assertEqual(ts.Duration, sameTS.Duration) + self.assertEqual(ts.TestcaseCount, sameTS.TestcaseCount) + self.assertEqual(ts.AssertionCount, sameTS.AssertionCount) + self.assertEqual(ts.Errored, sameTS.Errored) + self.assertEqual(ts.Skipped, sameTS.Skipped) + self.assertEqual(ts.Failed, sameTS.Failed) + self.assertEqual(ts.Passed, sameTS.Passed) + self.assertEqual(ts.Tests, sameTS.Tests) + + for tclsName, tcls, sameTCls in zipdicts(ts._testclasses, sameTS._testclasses): + self.assertEqual(tcls.Name, sameTCls.Name) + self.assertEqual(tcls.Classname, sameTCls.Classname) + self.assertEqual(tcls.TestcaseCount, sameTCls.TestcaseCount) + self.assertEqual(tcls.AssertionCount, sameTCls.AssertionCount) + + for tcName, tc, sameTC in zipdicts(tcls._testcases, sameTCls._testcases): + self.assertEqual(tc.Name, sameTC.Name) + self.assertEqual(tc.Classname, sameTC.Classname) + self.assertEqual(tc.Status, sameTC.Status) + self.assertEqual(tc.Duration, sameTC.Duration) + self.assertEqual(tc.AssertionCount, sameTC.AssertionCount) + + +class JavaAntJUnit4(TestCase): + def test_JUnit4(self): + print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Java-Ant-JUnit4/TEST-my.AllTests.xml") + doc = JUnit4Document(junitExampleFile, analyzeAndConvert=True) + + self.assertEqual(1, doc.TestsuiteCount) + self.assertEqual(2, doc.TestcaseCount) + + print(f"JUnit file:") + print(f" Testsuites: {doc.TestsuiteCount}") + print(f" Testcases: {doc.TestcaseCount}") + + print() + print(f"Statistics:") + print(f" Times: parsing by lxml: {doc.AnalysisDuration.total_seconds():.3f}s convert: {doc.ModelConversionDuration.total_seconds():.3f}s") + + def test_ReadWrite(self): + print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Java-Ant-JUnit4/TEST-my.AllTests.xml") + doc = JUnit4Document(junitExampleFile, analyzeAndConvert=True) + + junitOutputFile = Path("tests/output/JUnit/pyEDAA.Reports/Java-Ant-JUnit4/TEST-my.AllTests.xml") + junitOutputFile.parent.mkdir(parents=True, exist_ok=True) + doc.Write(junitOutputFile, regenerate=True, overwrite=True) + + sameDoc = JUnit4Document(junitOutputFile, analyzeAndConvert=True) + + self.assertEqual(doc.TestsuiteCount, sameDoc.TestsuiteCount) + self.assertEqual(doc.TestcaseCount, sameDoc.TestcaseCount) + self.assertEqual(doc.Errored, sameDoc.Errored) + self.assertEqual(doc.Skipped, sameDoc.Skipped) + self.assertEqual(doc.Failed, sameDoc.Failed) + self.assertEqual(doc.Passed, sameDoc.Passed) + self.assertEqual(doc.Tests, sameDoc.Tests) + + for tsName, ts, sameTS in zipdicts(doc._testsuites, sameDoc._testsuites): + self.assertEqual(ts.Name, sameTS.Name) + self.assertEqual(ts.Duration, sameTS.Duration) + self.assertEqual(ts.TestcaseCount, sameTS.TestcaseCount) + self.assertEqual(ts.AssertionCount, sameTS.AssertionCount) + self.assertEqual(ts.Errored, sameTS.Errored) + self.assertEqual(ts.Skipped, sameTS.Skipped) + self.assertEqual(ts.Failed, sameTS.Failed) + self.assertEqual(ts.Passed, sameTS.Passed) + self.assertEqual(ts.Tests, sameTS.Tests) + + for tclsName, tcls, sameTCls in zipdicts(ts._testclasses, sameTS._testclasses): + self.assertEqual(tcls.Name, sameTCls.Name) + self.assertEqual(tcls.Classname, sameTCls.Classname) + self.assertEqual(tcls.TestcaseCount, sameTCls.TestcaseCount) + self.assertEqual(tcls.AssertionCount, sameTCls.AssertionCount) + + for tcName, tc, sameTC in zipdicts(tcls._testcases, sameTCls._testcases): + self.assertEqual(tc.Name, sameTC.Name) + self.assertEqual(tc.Classname, sameTC.Classname) + self.assertEqual(tc.Status, sameTC.Status) + self.assertEqual(tc.Duration, sameTC.Duration) + self.assertEqual(tc.AssertionCount, sameTC.AssertionCount) + + +class PythonPyTest(TestCase): + def test_Read(self): + print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Python-pytest/TestReportSummary.xml") + doc = PyTestDocument(junitExampleFile, analyzeAndConvert=True) + + self.assertEqual(1, doc.TestsuiteCount) + self.assertEqual(8, doc.TestcaseCount) + self.assertEqual(0, doc.Errored) + self.assertEqual(0, doc.Skipped) + self.assertEqual(0, doc.Failed) + # self.assertEqual(8, doc.Passed) + self.assertEqual(8, doc.Tests) + + print(f"JUnit file:") + print(f" Testsuites: {doc.TestsuiteCount}") + print(f" Testcases: {doc.TestcaseCount}") + + print() + print(f"Statistics:") + print(f" Times: parsing by lxml: {doc.AnalysisDuration.total_seconds():.3f}s convert: {doc.ModelConversionDuration.total_seconds():.3f}s") + + def test_ReadWrite(self): + print() + + junitExampleFile = Path("tests/data/JUnit/pyEDAA.Reports/Python-pytest/TestReportSummary.xml") + doc = PyTestDocument(junitExampleFile, analyzeAndConvert=True) + + junitOutputFile = Path("tests/output/JUnit/pyEDAA.Reports/Python-pytest/TestReportSummary.xml") + junitOutputFile.parent.mkdir(parents=True, exist_ok=True) + doc.Write(junitOutputFile, regenerate=True, overwrite=True) + + sameDoc = PyTestDocument(junitOutputFile, analyzeAndConvert=True) + + self.assertEqual(doc.TestsuiteCount, sameDoc.TestsuiteCount) + self.assertEqual(doc.TestcaseCount, sameDoc.TestcaseCount) + self.assertEqual(doc.Errored, sameDoc.Errored) + self.assertEqual(doc.Skipped, sameDoc.Skipped) + self.assertEqual(doc.Failed, sameDoc.Failed) + self.assertEqual(doc.Passed, sameDoc.Passed) + self.assertEqual(doc.Tests, sameDoc.Tests) + + for tsName, ts, sameTS in zipdicts(doc._testsuites, sameDoc._testsuites): + self.assertEqual(ts.Name, sameTS.Name) + self.assertEqual(ts.Duration, sameTS.Duration) + self.assertEqual(ts.TestcaseCount, sameTS.TestcaseCount) + self.assertEqual(ts.AssertionCount, sameTS.AssertionCount) + self.assertEqual(ts.Errored, sameTS.Errored) + self.assertEqual(ts.Skipped, sameTS.Skipped) + self.assertEqual(ts.Failed, sameTS.Failed) + self.assertEqual(ts.Passed, sameTS.Passed) + self.assertEqual(ts.Tests, sameTS.Tests) + + for tclsName, tcls, sameTCls in zipdicts(ts._testclasses, sameTS._testclasses): + self.assertEqual(tcls.Name, sameTCls.Name) + self.assertEqual(tcls.Classname, sameTCls.Classname) + self.assertEqual(tcls.TestcaseCount, sameTCls.TestcaseCount) + self.assertEqual(tcls.AssertionCount, sameTCls.AssertionCount) + + for tcName, tc, sameTC in zipdicts(tcls._testcases, sameTCls._testcases): + self.assertEqual(tc.Name, sameTC.Name) + self.assertEqual(tc.Classname, sameTC.Classname) + self.assertEqual(tc.Status, sameTC.Status) + self.assertEqual(tc.Duration, sameTC.Duration) + self.assertEqual(tc.AssertionCount, sameTC.AssertionCount) From d62d4cfc47c597bb5fd28410a9a19bfaf71c6593 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 3 Nov 2024 17:33:35 +0100 Subject: [PATCH 6/6] Use InheritDocString from pyTooling. --- pyEDAA/Reports/Unittesting/JUnit/AntJUnit4.py | 15 ++++++-------- .../Reports/Unittesting/JUnit/CTestJUnit.py | 15 ++++++-------- .../Unittesting/JUnit/GoogleTestJUnit.py | 13 +++++------- .../Reports/Unittesting/JUnit/PyTestJUnit.py | 13 +++++------- pyEDAA/Reports/Unittesting/OSVVM.py | 20 +++++++++---------- 5 files changed, 31 insertions(+), 45 deletions(-) diff --git a/pyEDAA/Reports/Unittesting/JUnit/AntJUnit4.py b/pyEDAA/Reports/Unittesting/JUnit/AntJUnit4.py index a18028a7..33d473c6 100644 --- a/pyEDAA/Reports/Unittesting/JUnit/AntJUnit4.py +++ b/pyEDAA/Reports/Unittesting/JUnit/AntJUnit4.py @@ -37,8 +37,8 @@ from typing import Optional as Nullable, Generator, Tuple, Union, TypeVar, Type, ClassVar from lxml.etree import ElementTree, Element, SubElement, tostring, _Element -from pyTooling.Common import firstValue -from pyTooling.Decorators import export +from pyTooling.Common import firstValue +from pyTooling.Decorators import export, InheritDocString from pyEDAA.Reports.Unittesting import UnittestException, TestsuiteKind from pyEDAA.Reports.Unittesting import TestcaseStatus, TestsuiteStatus, IterationScheme @@ -51,11 +51,8 @@ TestsuiteAggregateReturnType = Tuple[int, int, int, int, int] -from pyEDAA.Reports.helper import InheritDocumentation - - @export -@InheritDocumentation(ju_Testcase, merge=True) +@InheritDocString(ju_Testcase, merge=True) class Testcase(ju_Testcase): """ This is a derived implementation for the Ant + JUnit4 dialect. @@ -63,7 +60,7 @@ class Testcase(ju_Testcase): @export -@InheritDocumentation(ju_Testclass, merge=True) +@InheritDocString(ju_Testclass, merge=True) class Testclass(ju_Testclass): """ This is a derived implementation for the Ant + JUnit4 dialect. @@ -71,7 +68,7 @@ class Testclass(ju_Testclass): @export -@InheritDocumentation(ju_Testsuite, merge=True) +@InheritDocString(ju_Testsuite, merge=True) class Testsuite(ju_Testsuite): """ This is a derived implementation for the Ant + JUnit4 dialect. @@ -166,7 +163,7 @@ def FromTestsuite(cls, testsuite: ut_Testsuite) -> "Testsuite": @export -@InheritDocumentation(ju_TestsuiteSummary, merge=True) +@InheritDocString(ju_TestsuiteSummary, merge=True) class TestsuiteSummary(ju_TestsuiteSummary): """ This is a derived implementation for the Ant + JUnit4 dialect. diff --git a/pyEDAA/Reports/Unittesting/JUnit/CTestJUnit.py b/pyEDAA/Reports/Unittesting/JUnit/CTestJUnit.py index 2d3f9689..bd4bd992 100644 --- a/pyEDAA/Reports/Unittesting/JUnit/CTestJUnit.py +++ b/pyEDAA/Reports/Unittesting/JUnit/CTestJUnit.py @@ -37,8 +37,8 @@ from typing import Optional as Nullable, Generator, Tuple, Union, TypeVar, Type, ClassVar from lxml.etree import ElementTree, Element, SubElement, tostring, _Element -from pyTooling.Common import firstValue -from pyTooling.Decorators import export +from pyTooling.Common import firstValue +from pyTooling.Decorators import export, InheritDocString from pyEDAA.Reports.Unittesting import UnittestException, TestsuiteKind from pyEDAA.Reports.Unittesting import TestcaseStatus, TestsuiteStatus, IterationScheme @@ -52,11 +52,8 @@ TestsuiteAggregateReturnType = Tuple[int, int, int, int, int] -from pyEDAA.Reports.helper import InheritDocumentation - - @export -@InheritDocumentation(ju_Testcase, merge=True) +@InheritDocString(ju_Testcase, merge=True) class Testcase(ju_Testcase): """ This is a derived implementation for the CTest JUnit dialect. @@ -64,7 +61,7 @@ class Testcase(ju_Testcase): @export -@InheritDocumentation(ju_Testclass, merge=True) +@InheritDocString(ju_Testclass, merge=True) class Testclass(ju_Testclass): """ This is a derived implementation for the CTest JUnit dialect. @@ -72,7 +69,7 @@ class Testclass(ju_Testclass): @export -@InheritDocumentation(ju_Testsuite, merge=True) +@InheritDocString(ju_Testsuite, merge=True) class Testsuite(ju_Testsuite): """ This is a derived implementation for the CTest JUnit dialect. @@ -167,7 +164,7 @@ def FromTestsuite(cls, testsuite: ut_Testsuite) -> "Testsuite": @export -@InheritDocumentation(ju_TestsuiteSummary, merge=True) +@InheritDocString(ju_TestsuiteSummary, merge=True) class TestsuiteSummary(ju_TestsuiteSummary): """ This is a derived implementation for the CTest JUnit dialect. diff --git a/pyEDAA/Reports/Unittesting/JUnit/GoogleTestJUnit.py b/pyEDAA/Reports/Unittesting/JUnit/GoogleTestJUnit.py index 5eab6db7..b21d6f08 100644 --- a/pyEDAA/Reports/Unittesting/JUnit/GoogleTestJUnit.py +++ b/pyEDAA/Reports/Unittesting/JUnit/GoogleTestJUnit.py @@ -37,7 +37,7 @@ from typing import Optional as Nullable, Generator, Tuple, Union, TypeVar, Type, ClassVar from lxml.etree import ElementTree, Element, SubElement, tostring, _Element -from pyTooling.Decorators import export +from pyTooling.Decorators import export, InheritDocString from pyEDAA.Reports.Unittesting import UnittestException, TestsuiteKind from pyEDAA.Reports.Unittesting import TestcaseStatus, TestsuiteStatus, IterationScheme @@ -51,11 +51,8 @@ TestsuiteAggregateReturnType = Tuple[int, int, int, int, int] -from pyEDAA.Reports.helper import InheritDocumentation - - @export -@InheritDocumentation(ju_Testcase, merge=True) +@InheritDocString(ju_Testcase, merge=True) class Testcase(ju_Testcase): """ This is a derived implementation for the GoogleTest JUnit dialect. @@ -63,7 +60,7 @@ class Testcase(ju_Testcase): @export -@InheritDocumentation(ju_Testclass, merge=True) +@InheritDocString(ju_Testclass, merge=True) class Testclass(ju_Testclass): """ This is a derived implementation for the GoogleTest JUnit dialect. @@ -71,7 +68,7 @@ class Testclass(ju_Testclass): @export -@InheritDocumentation(ju_Testsuite, merge=True) +@InheritDocString(ju_Testsuite, merge=True) class Testsuite(ju_Testsuite): """ This is a derived implementation for the GoogleTest JUnit dialect. @@ -166,7 +163,7 @@ def FromTestsuite(cls, testsuite: ut_Testsuite) -> "Testsuite": @export -@InheritDocumentation(ju_TestsuiteSummary, merge=True) +@InheritDocString(ju_TestsuiteSummary, merge=True) class TestsuiteSummary(ju_TestsuiteSummary): """ This is a derived implementation for the GoogleTest JUnit dialect. diff --git a/pyEDAA/Reports/Unittesting/JUnit/PyTestJUnit.py b/pyEDAA/Reports/Unittesting/JUnit/PyTestJUnit.py index dc7e3424..a9286ed9 100644 --- a/pyEDAA/Reports/Unittesting/JUnit/PyTestJUnit.py +++ b/pyEDAA/Reports/Unittesting/JUnit/PyTestJUnit.py @@ -37,7 +37,7 @@ from typing import Optional as Nullable, Generator, Tuple, Union, TypeVar, Type, ClassVar from lxml.etree import ElementTree, Element, SubElement, tostring, _Element -from pyTooling.Decorators import export +from pyTooling.Decorators import export, InheritDocString from pyEDAA.Reports.Unittesting import UnittestException, TestsuiteKind from pyEDAA.Reports.Unittesting import TestcaseStatus, TestsuiteStatus, IterationScheme @@ -51,11 +51,8 @@ TestsuiteAggregateReturnType = Tuple[int, int, int, int, int] -from pyEDAA.Reports.helper import InheritDocumentation - - @export -@InheritDocumentation(ju_Testcase, merge=True) +@InheritDocString(ju_Testcase, merge=True) class Testcase(ju_Testcase): """ This is a derived implementation for the pyTest JUnit dialect. @@ -63,7 +60,7 @@ class Testcase(ju_Testcase): @export -@InheritDocumentation(ju_Testclass, merge=True) +@InheritDocString(ju_Testclass, merge=True) class Testclass(ju_Testclass): """ This is a derived implementation for the pyTest JUnit dialect. @@ -71,7 +68,7 @@ class Testclass(ju_Testclass): @export -@InheritDocumentation(ju_Testsuite, merge=True) +@InheritDocString(ju_Testsuite, merge=True) class Testsuite(ju_Testsuite): """ This is a derived implementation for the pyTest JUnit dialect. @@ -166,7 +163,7 @@ def FromTestsuite(cls, testsuite: ut_Testsuite) -> "Testsuite": @export -@InheritDocumentation(ju_TestsuiteSummary, merge=True) +@InheritDocString(ju_TestsuiteSummary, merge=True) class TestsuiteSummary(ju_TestsuiteSummary): """ This is a derived implementation for the pyTest JUnit dialect. diff --git a/pyEDAA/Reports/Unittesting/OSVVM.py b/pyEDAA/Reports/Unittesting/OSVVM.py index 3b978bb8..04070e28 100644 --- a/pyEDAA/Reports/Unittesting/OSVVM.py +++ b/pyEDAA/Reports/Unittesting/OSVVM.py @@ -35,14 +35,12 @@ from typing import Optional as Nullable from ruamel.yaml import YAML, CommentedMap, CommentedSeq -from pyTooling.Decorators import export, notimplemented +from pyTooling.Decorators import export, InheritDocString, notimplemented from pyEDAA.Reports.Unittesting import UnittestException, Document, TestcaseStatus from pyEDAA.Reports.Unittesting import TestsuiteSummary as ut_TestsuiteSummary, Testsuite as ut_Testsuite from pyEDAA.Reports.Unittesting import Testcase as ut_Testcase -from pyEDAA.Reports.helper import InheritDocumentation - @export class OsvvmException: @@ -50,27 +48,27 @@ class OsvvmException: @export -@InheritDocumentation(UnittestException) +@InheritDocString(UnittestException) class UnittestException(UnittestException, OsvvmException): - """@InheritDocumentation(UnittestException)""" + """@InheritDocString(UnittestException)""" @export -@InheritDocumentation(ut_Testcase) +@InheritDocString(ut_Testcase) class Testcase(ut_Testcase): - """@InheritDocumentation(ut_Testcase)""" + """@InheritDocString(ut_Testcase)""" @export -@InheritDocumentation(ut_Testsuite) +@InheritDocString(ut_Testsuite) class Testsuite(ut_Testsuite): - """@InheritDocumentation(ut_Testsuite)""" + """@InheritDocString(ut_Testsuite)""" @export -@InheritDocumentation(ut_TestsuiteSummary) +@InheritDocString(ut_TestsuiteSummary) class TestsuiteSummary(ut_TestsuiteSummary): - """@InheritDocumentation(ut_TestsuiteSummary)""" + """@InheritDocString(ut_TestsuiteSummary)""" @export