44
55import pytest
66
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+
713def _run_test (testname ):
814 dirname = os .path .split (__file__ )[0 ]
915 exename = os .path .join (dirname , 'bin' , 'Python.DomainReloadTests.exe' )
@@ -12,90 +18,73 @@ def _run_test(testname):
1218 if platform .system () != 'Windows' :
1319 args = ['mono' ] + args
1420
15- proc = subprocess .Popen (args )
21+ env = os .environ .copy ()
22+ env ["PYTHONNET_PYDLL" ] = libpython
23+
24+ proc = subprocess .Popen (args , env = env )
1625 proc .wait ()
1726
1827 assert proc .returncode == 0
1928
20- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
2129def test_rename_class ():
2230 _run_test ('class_rename' )
2331
24- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
2532def test_rename_class_member_static_function ():
2633 _run_test ('static_member_rename' )
2734
28- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
2935def test_rename_class_member_function ():
3036 _run_test ('member_rename' )
3137
32- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
3338def test_rename_class_member_field ():
3439 _run_test ('field_rename' )
3540
36- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
3741def test_rename_class_member_property ():
3842 _run_test ('property_rename' )
3943
40- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
4144def test_rename_namespace ():
4245 _run_test ('namespace_rename' )
4346
44- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
4547def test_field_visibility_change ():
4648 _run_test ("field_visibility_change" )
4749
48- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
4950def test_method_visibility_change ():
5051 _run_test ("method_visibility_change" )
5152
52- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
5353def test_property_visibility_change ():
5454 _run_test ("property_visibility_change" )
5555
56- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
5756def test_class_visibility_change ():
5857 _run_test ("class_visibility_change" )
5958
6059@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' )
6260def test_method_parameters_change ():
6361 _run_test ("method_parameters_change" )
6462
65- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
6663def test_method_return_type_change ():
6764 _run_test ("method_return_type_change" )
6865
69- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
7066def test_field_type_change ():
7167 _run_test ("field_type_change" )
7268
73- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
7469@pytest .mark .xfail (reason = "Events not yet serializable" )
7570def test_rename_event ():
7671 _run_test ('event_rename' )
7772
78- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
7973@pytest .mark .xfail (reason = "newly instanced object uses PyType_GenericAlloc" )
8074def test_construct_removed_class ():
8175 _run_test ("construct_removed_class" )
8276
83- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
8477def test_out_to_ref_param ():
8578 _run_test ("out_to_ref_param" )
8679
87- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
8880def test_ref_to_out_param ():
8981 _run_test ("ref_to_out_param" )
9082
91- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
9283def test_ref_to_in_param ():
9384 _run_test ("ref_to_in_param" )
9485
95- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
9686def test_in_to_ref_param ():
9787 _run_test ("in_to_ref_param" )
9888
99- @pytest .mark .skipif (platform .system () == 'Darwin' , reason = 'FIXME: macos can\' t find the python library' )
10089def test_nested_type ():
10190 _run_test ("nested_type" )
0 commit comments