pytest-embedded 1.4.2__tar.gz → 1.6.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytest-embedded
3
- Version: 1.4.2
3
+ Version: 1.6.0
4
4
  Summary: A pytest plugin that designed for embedded testing.
5
5
  Author-email: Fu Hanxi <fuhanxi@espressif.com>
6
6
  Requires-Python: >=3.7
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.8
17
17
  Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
20
21
  Classifier: Programming Language :: Python
21
22
  Classifier: Topic :: Software Development :: Testing
22
23
  Requires-Dist: pytest>=7.0
@@ -20,6 +20,7 @@ classifiers = [
20
20
  "Programming Language :: Python :: 3.9",
21
21
  "Programming Language :: Python :: 3.10",
22
22
  "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
23
24
  "Programming Language :: Python",
24
25
  "Topic :: Software Development :: Testing",
25
26
  ]
@@ -5,4 +5,4 @@ from .dut import Dut
5
5
 
6
6
  __all__ = ['App', 'Dut']
7
7
 
8
- __version__ = '1.4.2'
8
+ __version__ = '1.6.0'
@@ -193,7 +193,7 @@ def pytest_addoption(parser):
193
193
  idf_group.addoption(
194
194
  '--panic-output-decode-script',
195
195
  help='Panic output decode script that is used in conjunction with the check-panic-coredump option '
196
- 'to parse panic output. (Default: $IDF_PATH/tools/gdb_panic_server.py)',
196
+ 'to parse panic output. (Default: use gdb_panic_server.py from package esp_idf_panic_decoder)',
197
197
  )
198
198
 
199
199
  jtag_group = parser.getgroup('embedded-jtag')
@@ -1088,6 +1088,7 @@ def _fixture_classes_and_options(
1088
1088
  'skip_regenerate_image': skip_regenerate_image,
1089
1089
  'encrypt': encrypt,
1090
1090
  'keyfile': keyfile,
1091
+ 'qemu_prog_path': qemu_prog_path,
1091
1092
  }
1092
1093
  )
1093
1094
  else:
@@ -1204,6 +1205,7 @@ def _fixture_classes_and_options(
1204
1205
  'qemu_extra_args': qemu_extra_args,
1205
1206
  'app': None,
1206
1207
  'meta': _meta,
1208
+ 'dut_index': dut_index,
1207
1209
  }
1208
1210
  elif fixture == 'wokwi':
1209
1211
  if 'wokwi' in _services:
@@ -1228,6 +1230,12 @@ def _fixture_classes_and_options(
1228
1230
  'test_case_name': test_case_name,
1229
1231
  'meta': _meta,
1230
1232
  }
1233
+ if 'idf' in _services and 'esp' not in _services:
1234
+ # esp,idf will use IdfDut, which based on IdfUnityDutMixin already
1235
+ from pytest_embedded_idf.unity_tester import IdfUnityDutMixin
1236
+
1237
+ mixins[fixture].append(IdfUnityDutMixin)
1238
+
1231
1239
  if 'wokwi' in _services:
1232
1240
  from pytest_embedded_wokwi import WokwiDut
1233
1241
 
@@ -1239,15 +1247,12 @@ def _fixture_classes_and_options(
1239
1247
  )
1240
1248
 
1241
1249
  if 'idf' in _services:
1242
- from pytest_embedded_idf.unity_tester import IdfUnityDutMixin
1243
1250
  from pytest_embedded_wokwi.idf import IDFFirmwareResolver
1244
1251
 
1245
1252
  kwargs['wokwi'].update({'firmware_resolver': IDFFirmwareResolver()})
1246
-
1247
- mixins[fixture].append(IdfUnityDutMixin)
1248
1253
  else:
1249
1254
  raise SystemExit('wokwi service should be used together with idf service')
1250
- if 'qemu' in _services:
1255
+ elif 'qemu' in _services:
1251
1256
  from pytest_embedded_qemu import QemuDut
1252
1257
 
1253
1258
  classes[fixture] = QemuDut
@@ -1256,11 +1261,6 @@ def _fixture_classes_and_options(
1256
1261
  'qemu': None,
1257
1262
  }
1258
1263
  )
1259
-
1260
- if 'idf' in _services:
1261
- from pytest_embedded_idf.unity_tester import IdfUnityDutMixin
1262
-
1263
- mixins[fixture].append(IdfUnityDutMixin)
1264
1264
  elif 'jtag' in _services:
1265
1265
  if 'idf' in _services:
1266
1266
  from pytest_embedded_idf import IdfDut
@@ -1409,18 +1409,18 @@ def dut(
1409
1409
  A device under test (DUT) object that could gather output from various sources and redirect them to the pexpect
1410
1410
  process, and run `expect()` via its pexpect process.
1411
1411
  """
1412
+ kwargs = _fixture_classes_and_options.kwargs['dut']
1413
+ mixins = _fixture_classes_and_options.mixins['dut']
1414
+
1415
+ # since there's no way to know the target before setup finished
1416
+ # we have to use the `app.target` to determine the dut class here
1412
1417
  if hasattr(app, 'target') and app.target == 'linux':
1413
1418
  from pytest_embedded_idf import LinuxDut
1414
1419
 
1415
1420
  cls = LinuxDut
1416
- kwargs = _fixture_classes_and_options.kwargs['dut']
1417
- kwargs['serial'] = serial
1418
-
1419
- return cls(**kwargs)
1420
-
1421
- cls = _fixture_classes_and_options.classes['dut']
1422
- mixins = _fixture_classes_and_options.mixins['dut']
1423
- kwargs = _fixture_classes_and_options.kwargs['dut']
1421
+ kwargs['serial'] = None # replace it later with LinuxSerial
1422
+ else:
1423
+ cls = _fixture_classes_and_options.classes['dut']
1424
1424
 
1425
1425
  for k, v in kwargs.items():
1426
1426
  if v is None:
File without changes