1
1
import os
2
2
import shutil
3
3
from pathlib import Path
4
- from typing import TYPE_CHECKING
5
4
6
- from . util import get_data
5
+ import pytest
7
6
8
- if TYPE_CHECKING :
9
- from _pytest .pytester import Pytester
7
+ from .util import get_data
10
8
11
9
12
10
def _load_v1_0_dir (path : Path ) -> None :
@@ -20,7 +18,7 @@ def _load_v1_0_dir(path: Path) -> None:
20
18
shutil .copy (get_data ("tests/test-data/v1.0/args.py" ), inner_dir )
21
19
22
20
23
- def test_include (pytester : " Pytester" ) -> None :
21
+ def test_include (pytester : pytest . Pytester ) -> None :
24
22
"""Test the pytest plugin using cwltool as cwl-runner."""
25
23
path = pytester .copy_example ("conformance_test_v1.0.cwltest.yml" )
26
24
shutil .copy (
@@ -36,7 +34,7 @@ def test_include(pytester: "Pytester") -> None:
36
34
result .assert_outcomes (passed = 1 , skipped = 1 )
37
35
38
36
39
- def test_exclude (pytester : " Pytester" ) -> None :
37
+ def test_exclude (pytester : pytest . Pytester ) -> None :
40
38
"""Test the pytest plugin using cwltool as cwl-runner."""
41
39
path = pytester .copy_example ("conformance_test_v1.0.cwltest.yml" )
42
40
shutil .copy (
@@ -52,7 +50,7 @@ def test_exclude(pytester: "Pytester") -> None:
52
50
result .assert_outcomes (passed = 0 , skipped = 2 )
53
51
54
52
55
- def test_tags (pytester : " Pytester" ) -> None :
53
+ def test_tags (pytester : pytest . Pytester ) -> None :
56
54
"""Test the pytest plugin using cwltool as cwl-runner."""
57
55
path = pytester .copy_example ("conformance_test_v1.0.cwltest.yml" )
58
56
shutil .copy (
@@ -65,7 +63,7 @@ def test_tags(pytester: "Pytester") -> None:
65
63
result .assert_outcomes (passed = 1 , skipped = 1 )
66
64
67
65
68
- def test_exclude_tags (pytester : " Pytester" ) -> None :
66
+ def test_exclude_tags (pytester : pytest . Pytester ) -> None :
69
67
"""Test the pytest plugin using cwltool as cwl-runner."""
70
68
path = pytester .copy_example ("conformance_test_v1.0.cwltest.yml" )
71
69
shutil .copy (
@@ -81,7 +79,7 @@ def test_exclude_tags(pytester: "Pytester") -> None:
81
79
result .assert_outcomes (skipped = 2 )
82
80
83
81
84
- def test_badgedir (pytester : " Pytester" ) -> None :
82
+ def test_badgedir (pytester : pytest . Pytester ) -> None :
85
83
"""Test the pytest plugin creates the badges directory."""
86
84
path = pytester .copy_example ("conformance_test_v1.0.cwltest.yml" )
87
85
shutil .copy (
@@ -95,7 +93,7 @@ def test_badgedir(pytester: "Pytester") -> None:
95
93
assert os .path .exists ("cwl-badges" )
96
94
97
95
98
- def test_no_label (pytester : " Pytester" ) -> None :
96
+ def test_no_label (pytester : pytest . Pytester ) -> None :
99
97
"""Test the pytest plugin correctly extracts test names from the id field when label is missing."""
100
98
path = pytester .copy_example ("conformance_test_v1.2.cwltest.yaml" )
101
99
shutil .copy (
@@ -108,7 +106,7 @@ def test_no_label(pytester: "Pytester") -> None:
108
106
result .assert_outcomes (passed = 2 , skipped = 1 )
109
107
110
108
111
- def test_cwltool_hook (pytester : " Pytester" ) -> None :
109
+ def test_cwltool_hook (pytester : pytest . Pytester ) -> None :
112
110
"""Test the pytest plugin using cwltool as cwl-runner."""
113
111
path = pytester .copy_example ("conformance_test_v1.0.cwltest.yml" )
114
112
shutil .copy (
@@ -119,7 +117,7 @@ def test_cwltool_hook(pytester: "Pytester") -> None:
119
117
result .assert_outcomes (passed = 2 )
120
118
121
119
122
- def test_no_hook (pytester : " Pytester" ) -> None :
120
+ def test_no_hook (pytester : pytest . Pytester ) -> None :
123
121
"""Test the pytest plugin using the default cwl-runner."""
124
122
path = pytester .copy_example ("conformance_test_v1.0.cwltest.yml" )
125
123
_load_v1_0_dir (path )
0 commit comments