4
4
5
5
import pytest
6
6
7
+ from pythonnet .find_libpython import find_libpython
8
+ libpython = find_libpython ()
9
+
10
+ pytestmark = pytest .mark .xfail (libpython is None ,reason = "Can't find suitable libpython" )
11
+
12
+
7
13
def _run_test (testname ):
8
14
dirname = os .path .split (__file__ )[0 ]
9
15
exename = os .path .join (dirname ,'bin' ,'Python.DomainReloadTests.exe' )
@@ -12,90 +18,73 @@ def _run_test(testname):
12
18
if platform .system ()!= 'Windows' :
13
19
args = ['mono' ]+ args
14
20
15
- proc = subprocess .Popen (args )
21
+ env = os .environ .copy ()
22
+ env ["PYTHONNET_PYDLL" ]= libpython
23
+
24
+ proc = subprocess .Popen (args ,env = env )
16
25
proc .wait ()
17
26
18
27
assert proc .returncode == 0
19
28
20
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
21
29
def test_rename_class ():
22
30
_run_test ('class_rename' )
23
31
24
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
25
32
def test_rename_class_member_static_function ():
26
33
_run_test ('static_member_rename' )
27
34
28
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
29
35
def test_rename_class_member_function ():
30
36
_run_test ('member_rename' )
31
37
32
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
33
38
def test_rename_class_member_field ():
34
39
_run_test ('field_rename' )
35
40
36
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
37
41
def test_rename_class_member_property ():
38
42
_run_test ('property_rename' )
39
43
40
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
41
44
def test_rename_namespace ():
42
45
_run_test ('namespace_rename' )
43
46
44
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
45
47
def test_field_visibility_change ():
46
48
_run_test ("field_visibility_change" )
47
49
48
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
49
50
def test_method_visibility_change ():
50
51
_run_test ("method_visibility_change" )
51
52
52
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
53
53
def test_property_visibility_change ():
54
54
_run_test ("property_visibility_change" )
55
55
56
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
57
56
def test_class_visibility_change ():
58
57
_run_test ("class_visibility_change" )
59
58
60
59
@pytest .mark .skip (reason = 'FIXME: Domain reload fails when Python points to a .NET object which points back to Python objects' )
61
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
62
60
def test_method_parameters_change ():
63
61
_run_test ("method_parameters_change" )
64
62
65
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
66
63
def test_method_return_type_change ():
67
64
_run_test ("method_return_type_change" )
68
65
69
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
70
66
def test_field_type_change ():
71
67
_run_test ("field_type_change" )
72
68
73
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
74
69
@pytest .mark .xfail (reason = "Events not yet serializable" )
75
70
def test_rename_event ():
76
71
_run_test ('event_rename' )
77
72
78
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
79
73
@pytest .mark .xfail (reason = "newly instanced object uses PyType_GenericAlloc" )
80
74
def test_construct_removed_class ():
81
75
_run_test ("construct_removed_class" )
82
76
83
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
84
77
def test_out_to_ref_param ():
85
78
_run_test ("out_to_ref_param" )
86
79
87
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
88
80
def test_ref_to_out_param ():
89
81
_run_test ("ref_to_out_param" )
90
82
91
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
92
83
def test_ref_to_in_param ():
93
84
_run_test ("ref_to_in_param" )
94
85
95
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
96
86
def test_in_to_ref_param ():
97
87
_run_test ("in_to_ref_param" )
98
88
99
- @pytest .mark .skipif (platform .system ()== 'Darwin' ,reason = 'FIXME: macos can\' t find the python library' )
100
89
def test_nested_type ():
101
90
_run_test ("nested_type" )