diff --git a/testing/cffi0/test_verify.py b/testing/cffi0/test_verify.py index b7710932..a6ca23cd 100644 --- a/testing/cffi0/test_verify.py +++ b/testing/cffi0/test_verify.py @@ -2174,22 +2174,23 @@ def test_verify_dlopen_flags(): ffi1 = FFI() ffi1.cdef("extern int foo_verify_dlopen_flags;") + modulename = "_cffi_test_verify_dlopen_flags_%d" % random.randint(0, 1000000000) lib1 = ffi1.verify("int foo_verify_dlopen_flags;", flags=ffi1.RTLD_GLOBAL | ffi1.RTLD_LAZY, - modulename="_cffi_test_verify_dlopen_flags") - lib2 = get_second_lib() + modulename=modulename) + lib2 = get_second_lib(modulename) lib1.foo_verify_dlopen_flags = 42 assert lib2.foo_verify_dlopen_flags == 42 lib2.foo_verify_dlopen_flags += 1 assert lib1.foo_verify_dlopen_flags == 43 -def get_second_lib(): +def get_second_lib(modulename): ffi2 = FFI() ffi2.cdef("extern int foo_verify_dlopen_flags;") lib2 = ffi2.verify("int foo_verify_dlopen_flags;", flags=ffi2.RTLD_GLOBAL | ffi2.RTLD_LAZY, - modulename="_cffi_test_verify_dlopen_flags") + modulename=modulename) return lib2 def test_consider_not_implemented_function_type(): @@ -2257,7 +2258,7 @@ def test_implicit_unicode_on_windows(): def test_use_local_dir(): ffi = FFI() - lib = ffi.verify("", modulename="test_use_local_dir") + lib = ffi.verify("", modulename="_cffi_test_use_local_dir") this_dir = os.path.dirname(__file__) pycache_files = os.listdir(os.path.join(this_dir, '__pycache__')) assert any('test_use_local_dir' in s for s in pycache_files) diff --git a/testing/cffi0/test_vgen2.py b/testing/cffi0/test_vgen2.py index 34147c87..2cd1634c 100644 --- a/testing/cffi0/test_vgen2.py +++ b/testing/cffi0/test_vgen2.py @@ -3,7 +3,8 @@ # This test file runs normally after test_vgen. We only clean up the .c # sources, to check that it also works when we have only the .so. The -# tests should run much faster than test_vgen. +# tests used to run much faster than test_vgen, but since we randomize +# the module names, it needs to recompile everything. def setup_module(): cffi.verifier.cleanup_tmpdir(keep_so=True)