1
+ import shutil
1
2
import pytest
2
3
from subprocess import check_call
3
4
import os
@@ -24,7 +25,7 @@ def build_example(tmpdir_factory, framework):
24
25
return out
25
26
26
27
27
- def test_mono (example_netstandard ):
28
+ def test_mono (example_netstandard : Path ):
28
29
from clr_loader import get_mono
29
30
30
31
mono = get_mono ()
@@ -33,7 +34,7 @@ def test_mono(example_netstandard):
33
34
run_tests (asm )
34
35
35
36
36
- def test_mono_debug (example_netstandard ):
37
+ def test_mono_debug (example_netstandard : Path ):
37
38
from clr_loader import get_mono
38
39
39
40
mono = get_mono (
@@ -46,23 +47,26 @@ def test_mono_debug(example_netstandard):
46
47
47
48
run_tests (asm )
48
49
49
- def test_mono_signal_chaining (example_netstandard ):
50
+
51
+ def test_mono_signal_chaining (example_netstandard : Path ):
50
52
from clr_loader import get_mono
51
53
52
54
mono = get_mono (set_signal_chaining = True )
53
55
asm = mono .get_assembly (example_netstandard / "example.dll" )
54
56
55
57
run_tests (asm )
56
58
57
- def test_mono_set_dir (example_netstandard ):
59
+
60
+ def test_mono_set_dir (example_netstandard : Path ):
58
61
from clr_loader import get_mono
59
62
60
63
mono = get_mono (assembly_dir = "/usr/lib" , config_dir = "/etc" )
61
64
asm = mono .get_assembly (example_netstandard / "example.dll" )
62
65
63
66
run_tests (asm )
64
67
65
- def test_coreclr (example_netcore ):
68
+
69
+ def test_coreclr (example_netcore : Path ):
66
70
from clr_loader import get_coreclr
67
71
68
72
coreclr = get_coreclr (runtime_config = example_netcore / "example.runtimeconfig.json" )
@@ -71,7 +75,7 @@ def test_coreclr(example_netcore):
71
75
run_tests (asm )
72
76
73
77
74
- def test_coreclr_autogenerated_runtimeconfig (example_netstandard ):
78
+ def test_coreclr_autogenerated_runtimeconfig (example_netstandard : Path ):
75
79
from multiprocessing import get_context
76
80
77
81
p = get_context ("spawn" ).Process (
@@ -82,7 +86,7 @@ def test_coreclr_autogenerated_runtimeconfig(example_netstandard):
82
86
p .close ()
83
87
84
88
85
- def _do_test_coreclr_autogenerated_runtimeconfig (example_netstandard ):
89
+ def _do_test_coreclr_autogenerated_runtimeconfig (example_netstandard : Path ):
86
90
from clr_loader import get_coreclr
87
91
88
92
coreclr = get_coreclr ()
@@ -94,9 +98,24 @@ def _do_test_coreclr_autogenerated_runtimeconfig(example_netstandard):
94
98
@pytest .mark .skipif (
95
99
sys .platform != "win32" , reason = ".NET Framework only exists on Windows"
96
100
)
97
- def test_netfx (example_netstandard ):
101
+ def test_netfx (example_netstandard : Path ):
102
+ from clr_loader import get_netfx
103
+
104
+ netfx = get_netfx ()
105
+ asm = netfx .get_assembly (example_netstandard / "example.dll" )
106
+
107
+ run_tests (asm )
108
+
109
+
110
+ @pytest .mark .skipif (
111
+ sys .platform != "win32" , reason = ".NET Framework only exists on Windows"
112
+ )
113
+ def test_netfx_chinese_path (example_netstandard : Path , tmpdir_factory ):
98
114
from clr_loader import get_netfx
99
115
116
+ tmp_path = Path (tmpdir_factory .mktemp ("example-中国" ))
117
+ shutil .copytree (example_netstandard , tmp_path , dirs_exist_ok = True )
118
+
100
119
netfx = get_netfx ()
101
120
asm = netfx .get_assembly (os .path .join (example_netstandard , "example.dll" ))
102
121
0 commit comments