Skip to content

Commit

Permalink
rename possibly identical modules to prevent test collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Oct 11, 2024
1 parent 88f48d2 commit 3060390
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion testing/cffi0/test_verify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
import pytest
import sys, os, math, weakref
import sys, os, math, weakref, random
from cffi import FFI, VerificationError, VerificationMissing, model, FFIError
from testing.support import *
from testing.support import extra_compile_args, is_musl
Expand All @@ -18,9 +18,19 @@
if distutils.ccompiler.get_default_compiler() == 'msvc':
lib_m = ['msvcrt']
pass # no obvious -Werror equivalent on MSVC
class FFI(FFI):
def verify(self, *args, **kwds):
modulename = kwds.get("modulename", "_cffi_test%d_%d" % (
random.randint(0,32000), random.randint(0,32000)))
kwds["modulename"] = modulename
return super(FFI, self).verify(*args, **kwds)

else:
class FFI(FFI):
def verify(self, *args, **kwds):
modulename = kwds.get("modulename", "_cffi_test%d_%d" % (
random.randint(0,32000), random.randint(0,32000)))
kwds["modulename"] = modulename
return super(FFI, self).verify(
*args, extra_compile_args=extra_compile_args, **kwds)

Expand Down

0 comments on commit 3060390

Please sign in to comment.