Skip to content

Commit 33cba38

Browse files
authored
Merge pull request #159 from MaximilianSoerenPollak/MSP_fix_python_decorator
Fixing test properties for python
2 parents 6a333a8 + 136b92d commit 33cba38

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

process/process_areas/verification/guidance/verification_process_toolreqs.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,28 @@ Test Linking to Requirements
9191
:complies: std_req__iso26262__support_6432
9292

9393

94-
For linking python tests to requirements **metadata** shall be used. Attributes which are
95-
common for all test cases can be specified in the Test Suite (above the class), the other
96-
attributes which are specific for each test case need to be specified above the test case:
94+
For linking python tests to requirements **metadata** shall be used.
95+
For this the 'add_test_properties' decorator has been provided.
96+
You need to add it to the test and fill out:
97+
98+
* partially_verifies OR fully_verifies
99+
* test_type
100+
* derivation_technique
101+
102+
For allowed values for test_type & derivation_technique please check :need:`gd_req__verification_link_tests`
103+
Further more, this decorator will also check if your test has a `docstring` which should act as the description of the test.
104+
97105

98106
.. code-block:: python
99107
100-
@pytest.fixture(scope="session", autouse=True)
101-
def add_metadata(record_testsuite_property):
102-
record_testsuite_property("TestType", "<TestType>")
103-
record_testsuite_property("DerivationTechnique", "<DerivationTechnique>")
104-
class Testclass(TestSim):
105-
106-
def TestFunction(self, record_property):
107-
record_property("PartiallyVerifies", "ID_2, ID_3, ...")
108-
record_property("FullyVerifies", "ID_4, ID_5, ...")
109-
record_property("Description","<Description>")
108+
@add_test_properties(
109+
partially_verifies=["tool_req__docs_dd_link_source_code_link"],
110+
test_type="requirements-based",
111+
derivation_technique="requirements-analysis",
112+
)
113+
def test_group_by_need_empty_list():
114+
"""Test grouping empty list of needlinks."""
115+
...
110116
111117
.. gd_req:: Linking Requirements to Tests (Rust)
112118
:id: gd_req__verification_link_tests_rust

0 commit comments

Comments
 (0)