88def example_netstandard (tmpdir_factory ):
99 return build_example (tmpdir_factory , "netstandard20" )
1010
11+
1112@pytest .fixture (scope = "session" )
1213def example_netcore (tmpdir_factory ):
1314 return build_example (tmpdir_factory , "netcoreapp31" )
1415
16+
1517def build_example (tmpdir_factory , framework ):
1618 out = str (tmpdir_factory .mktemp (f"example-{ framework } " ))
1719 proj_path = os .path .join (os .path .dirname (__file__ ), "../example" )
@@ -24,21 +26,7 @@ def build_example(tmpdir_factory, framework):
2426def test_mono (example_netstandard ):
2527 from clr_loader import get_mono
2628
27- if sys .platform == 'win32' :
28- if sys .maxsize > 2 ** 32 :
29- prog_files = os .environ .get ("ProgramFiles" )
30- else :
31- prog_files = os .environ .get ("ProgramFiles(x86)" )
32-
33- path = fr"{ prog_files } \Mono\bin\mono-2.0-sgen.dll"
34-
35- elif sys .platform == "darwin" :
36- path = "/Library/Frameworks/Mono.framework/Versions/Current/lib/libmono-2.0.dylib"
37-
38- else :
39- path = None
40-
41- mono = get_mono (path = path )
29+ mono = get_mono ()
4230 asm = mono .get_assembly (os .path .join (example_netstandard , "example.dll" ))
4331
4432 run_tests (asm )
@@ -53,7 +41,9 @@ def test_coreclr(example_netcore):
5341 run_tests (asm )
5442
5543
56- @pytest .mark .skipif (sys .platform != 'win32' , reason = ".NET Framework only exists on Windows" )
44+ @pytest .mark .skipif (
45+ sys .platform != "win32" , reason = ".NET Framework only exists on Windows"
46+ )
5747def test_netfx (example_netstandard ):
5848 from clr_loader import get_netfx
5949
@@ -68,4 +58,3 @@ def run_tests(asm):
6858 test_data = b"testy mctestface"
6959 res = func (test_data )
7060 assert res == len (test_data )
71-
0 commit comments