|
1 | 1 | import logging
|
2 | 2 | import os
|
3 |
| -from typing import Sequence |
| 3 | +from typing import Callable, Sequence, Union |
4 | 4 | import pytest
|
5 | 5 | import pytest_dependency # type: ignore
|
6 | 6 | import tempfile
|
7 | 7 | import xml.etree.ElementTree as ET
|
8 | 8 |
|
9 | 9 | from lib import installer, pxe
|
10 |
| -from lib.common import callable_marker, url_download, wait_for |
| 10 | +from lib.common import callable_marker, ensure_type, url_download, wait_for |
11 | 11 | from lib.installer import AnswerFile
|
12 | 12 | from lib.commands import local_cmd
|
13 | 13 |
|
@@ -66,8 +66,8 @@ def answerfile(request):
|
66 | 66 | return
|
67 | 67 |
|
68 | 68 | # construct answerfile definition from option "base", and explicit bits
|
69 |
| - answerfile_def = callable_marker(marker.args[0], request) |
70 |
| - assert isinstance(answerfile_def, AnswerFile) |
| 69 | + marker_args = ensure_type(Sequence[Union[AnswerFile, Callable[..., AnswerFile]]], marker.args) |
| 70 | + answerfile_def = callable_marker(marker_args[0], request) |
71 | 71 |
|
72 | 72 | answerfile_def.top_append(
|
73 | 73 | dict(TAG="admin-interface",
|
@@ -329,8 +329,8 @@ def xcpng_chained(request):
|
329 | 329 | # take test name from mark
|
330 | 330 | marker = request.node.get_closest_marker("continuation_of")
|
331 | 331 | assert marker is not None, "xcpng_chained fixture requires 'continuation_of' marker"
|
332 |
| - continuation_of = callable_marker(marker.args[0], request) |
333 |
| - assert isinstance(continuation_of, Sequence) |
| 332 | + marker_args = ensure_type(Sequence[Union[Sequence[dict], Callable[..., Sequence[dict]]]], marker.args) |
| 333 | + continuation_of = callable_marker(marker_args[0], request) |
334 | 334 |
|
335 | 335 | vm_defs = [dict(name=vm_spec['vm'],
|
336 | 336 | image_test=vm_spec['image_test'],
|
|
0 commit comments