|
4 | 4 | from datetime import timedelta |
5 | 5 | from pathlib import Path |
6 | 6 | from typing import Iterable |
| 7 | +from typing import List |
7 | 8 | from typing import Optional |
8 | 9 | from typing import Sequence |
9 | 10 | from typing import Tuple |
10 | 11 |
|
11 | 12 | from pytest_container import DerivedContainer |
12 | 13 | from pytest_container.container import ContainerVolume |
13 | 14 | from pytest_container.container import PortForwarding |
14 | | -from pytest_container.container import container_and_marks_from_pytest_param |
15 | 15 | from pytest_container.runtime import LOCALHOST |
16 | 16 |
|
17 | 17 | try: |
@@ -292,7 +292,7 @@ def create_BCI( |
292 | 292 | bci_type: ImageType = ImageType.LANGUAGE_STACK, |
293 | 293 | container_user: Optional[str] = None, |
294 | 294 | **kwargs, |
295 | | -) -> ParameterSet: |
| 295 | +) -> DerivedContainer: |
296 | 296 | """Creates a DerivedContainer wrapped in a pytest.param for the BCI with the |
297 | 297 | given ``build_tag``. |
298 | 298 |
|
@@ -395,14 +395,11 @@ def create_BCI( |
395 | 395 | else: |
396 | 396 | containerfile = _BCI_REPLACE_REPO_CONTAINERFILE |
397 | 397 |
|
398 | | - return pytest.param( |
399 | | - DerivedContainer( |
400 | | - base=baseurl, |
401 | | - containerfile=containerfile, |
402 | | - **kwargs, |
403 | | - ), |
| 398 | + return DerivedContainer( |
| 399 | + base=baseurl, |
| 400 | + containerfile=containerfile, |
404 | 401 | marks=marks, |
405 | | - id=f"{build_tag} from {baseurl}", |
| 402 | + **kwargs, |
406 | 403 | ) |
407 | 404 |
|
408 | 405 |
|
@@ -1086,23 +1083,19 @@ def create_BCI( |
1086 | 1083 | ) |
1087 | 1084 |
|
1088 | 1085 | #: all containers with zypper and with the flag to launch them as root |
1089 | | -CONTAINERS_WITH_ZYPPER_AS_ROOT = [] |
1090 | | -for param in CONTAINERS_WITH_ZYPPER: |
| 1086 | +CONTAINERS_WITH_ZYPPER_AS_ROOT: List[DerivedContainer] = [] |
| 1087 | +for ctr in CONTAINERS_WITH_ZYPPER: |
1091 | 1088 | # only modify the user for containers where `USER` is explicitly set, |
1092 | 1089 | # atm this is no container |
1093 | | - if param not in []: |
1094 | | - CONTAINERS_WITH_ZYPPER_AS_ROOT.append(param) |
| 1090 | + if ctr not in []: |
| 1091 | + CONTAINERS_WITH_ZYPPER_AS_ROOT.append(ctr) |
1095 | 1092 | else: |
1096 | | - ctr, marks = container_and_marks_from_pytest_param(param) |
1097 | 1093 | CONTAINERS_WITH_ZYPPER_AS_ROOT.append( |
1098 | | - pytest.param( |
1099 | | - DerivedContainer( |
1100 | | - base=ctr, |
1101 | | - extra_launch_args=( |
1102 | | - (ctr.extra_launch_args or []) + ["--user", "root"] |
1103 | | - ), |
| 1094 | + DerivedContainer( |
| 1095 | + base=ctr, |
| 1096 | + extra_launch_args=( |
| 1097 | + (ctr.extra_launch_args or []) + ["--user", "root"] |
1104 | 1098 | ), |
1105 | | - marks=marks, |
1106 | 1099 | ) |
1107 | 1100 | ) |
1108 | 1101 |
|
@@ -1214,13 +1207,12 @@ def has_xfail(param: ParameterSet) -> bool: |
1214 | 1207 | return True |
1215 | 1208 | return False |
1216 | 1209 |
|
1217 | | - for param in ALL_CONTAINERS: |
| 1210 | + for ctr in ALL_CONTAINERS: |
1218 | 1211 | # don't check containers which are known broken or excluded |
1219 | | - if has_true_skipif(param) or has_xfail(param): |
| 1212 | + if has_true_skipif(ctr) or has_xfail(ctr): |
1220 | 1213 | continue |
1221 | 1214 |
|
1222 | | - ctr, marks = container_and_marks_from_pytest_param(param) |
1223 | | - for mark in marks or []: |
| 1215 | + for mark in ctr.marks or []: |
1224 | 1216 | assert mark.name in custom_markers.union( |
1225 | 1217 | {"xfail", "skipif", "skip"} |
1226 | 1218 | ), ( |
|
0 commit comments