pytest-embedded 1.18.0__tar.gz → 1.18.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/PKG-INFO +1 -1
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/__init__.py +1 -1
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/dut_factory.py +13 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/plugin.py +11 -3
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/LICENSE +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/README.md +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pyproject.toml +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/app.py +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/dut.py +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/log.py +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/unity.py +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/pytest_embedded/utils.py +0 -0
- {pytest_embedded-1.18.0 → pytest_embedded-1.18.2}/tests/test_base.py +0 -0
|
@@ -849,3 +849,16 @@ class DutFactory:
|
|
|
849
849
|
_close_or_terminate(obj)
|
|
850
850
|
del layout
|
|
851
851
|
raise e
|
|
852
|
+
|
|
853
|
+
@classmethod
|
|
854
|
+
def get_all_duts(cls) -> t.List[Dut]:
|
|
855
|
+
"""Get all DUTs created by DutFactory."""
|
|
856
|
+
|
|
857
|
+
duts = []
|
|
858
|
+
for layout in cls.obj_stack:
|
|
859
|
+
# The DUT is always the last object in the layout
|
|
860
|
+
dut = layout[-1]
|
|
861
|
+
if isinstance(dut, Dut):
|
|
862
|
+
duts.append(dut)
|
|
863
|
+
|
|
864
|
+
return duts
|
|
@@ -1398,10 +1398,18 @@ class PytestEmbedded:
|
|
|
1398
1398
|
|
|
1399
1399
|
@pytest.hookimpl(trylast=True)
|
|
1400
1400
|
def pytest_runtest_call(self, item: Function):
|
|
1401
|
-
|
|
1401
|
+
all_duts: list[Dut] = []
|
|
1402
|
+
|
|
1403
|
+
# Check DUTs created by fixture
|
|
1402
1404
|
if 'dut' in item.funcargs:
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
+
fixture_duts = [dut for dut in to_list(item.funcargs['dut']) if isinstance(dut, Dut)]
|
|
1406
|
+
all_duts.extend(fixture_duts)
|
|
1407
|
+
|
|
1408
|
+
# Check DUTs created by DutFactory
|
|
1409
|
+
factory_duts = DutFactory.get_all_duts()
|
|
1410
|
+
all_duts.extend(factory_duts)
|
|
1411
|
+
|
|
1412
|
+
self._raise_dut_failed_cases_if_exists(all_duts) # type: ignore
|
|
1405
1413
|
|
|
1406
1414
|
@pytest.hookimpl(trylast=True) # combine all possible junit reports should be the last step
|
|
1407
1415
|
def pytest_sessionfinish(self, session: Session, exitstatus: int) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|