1 # Python test set -- supporting definitions.
3 TestFailed
= 'test_support -- test failed' # Exception
5 verbose
= 1 # Flag set to 0 by regrtest.py
17 for dirname
in sys
.path
:
19 os
.unlink(os
.path
.join(dirname
, modname
+ '.pyc'))
25 def fcmp(x
, y
): # fuzzy comparison function
26 if type(x
) == type(0.0) or type(y
) == type(0.0):
29 fuzz
= (abs(x
) + abs(y
)) * FUZZ
34 elif type(x
) == type(y
) and type(x
) in (type(()), type([])):
35 for i
in range(min(len(x
), len(y
))):
36 outcome
= fcmp(x
[i
], y
[i
])
39 return cmp(len(x
), len(y
))
42 TESTFN
= '@test' # Filename used for testing
45 def findfile(file, here
=__file__
):
47 if os
.path
.isabs(file):
51 path
= [os
.path
.dirname(here
)] + path
53 fn
= os
.path
.join(dn
, file)
54 if os
.path
.exists(fn
): return fn