pytest-embedded 2.2.0__tar.gz → 2.2.1__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-2.2.0 → pytest_embedded-2.2.1}/PKG-INFO +1 -1
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/__init__.py +1 -1
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/dut_factory.py +13 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/plugin.py +11 -3
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/LICENSE +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/README.md +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pyproject.toml +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/app.py +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/dut.py +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/log.py +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/unity.py +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/pytest_embedded/utils.py +0 -0
- {pytest_embedded-2.2.0 → pytest_embedded-2.2.1}/tests/test_base.py +0 -0
|
@@ -838,3 +838,16 @@ class DutFactory:
|
|
|
838
838
|
_close_or_terminate(obj)
|
|
839
839
|
del layout
|
|
840
840
|
raise e
|
|
841
|
+
|
|
842
|
+
@classmethod
|
|
843
|
+
def get_all_duts(cls) -> list[Dut]:
|
|
844
|
+
"""Get all DUTs created by DutFactory."""
|
|
845
|
+
|
|
846
|
+
duts = []
|
|
847
|
+
for layout in cls.obj_stack:
|
|
848
|
+
# The DUT is always the last object in the layout
|
|
849
|
+
dut = layout[-1]
|
|
850
|
+
if isinstance(dut, Dut):
|
|
851
|
+
duts.append(dut)
|
|
852
|
+
|
|
853
|
+
return duts
|
|
@@ -1372,10 +1372,18 @@ class PytestEmbedded:
|
|
|
1372
1372
|
|
|
1373
1373
|
@pytest.hookimpl(trylast=True)
|
|
1374
1374
|
def pytest_runtest_call(self, item: Function):
|
|
1375
|
-
|
|
1375
|
+
all_duts: list[Dut] = []
|
|
1376
|
+
|
|
1377
|
+
# Check DUTs created by fixture
|
|
1376
1378
|
if 'dut' in item.funcargs:
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
+
fixture_duts = [dut for dut in to_list(item.funcargs['dut']) if isinstance(dut, Dut)]
|
|
1380
|
+
all_duts.extend(fixture_duts)
|
|
1381
|
+
|
|
1382
|
+
# Check DUTs created by DutFactory
|
|
1383
|
+
factory_duts = DutFactory.get_all_duts()
|
|
1384
|
+
all_duts.extend(factory_duts)
|
|
1385
|
+
|
|
1386
|
+
self._raise_dut_failed_cases_if_exists(all_duts) # type: ignore
|
|
1379
1387
|
|
|
1380
1388
|
@pytest.hookimpl(trylast=True) # combine all possible junit reports should be the last step
|
|
1381
1389
|
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
|