Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/IronPython.Tests/Cases/IronPythonCasesManifest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ NotParallelSafe=true # Uses a temporary module with a fixed name
[IronPython.modules.misc.test__weakref]
RetryCount=2

[IronPython.modules.misc.test_zlib]

[IronPython.modules.system_related.test_nt]
RunCondition=NOT $(IS_POSIX)
NotParallelSafe=true # Uses fixed file, directory, and environment variable names
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/interop/net/field/test_field_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def test_accessibility(self):
self.assertIn('ProtectedField', dir(o))
with self.assertRaises(TypeError):
hasattr(o, 'ProtectedField')
self.assertRaisesRegexp(AttributeError, "'Misc' object has no attribute 'PrivateField'", lambda: o.PrivateField)
self.assertRaisesRegex(AttributeError, "'Misc' object has no attribute 'PrivateField'", lambda: o.PrivateField)
self.assertEqual(o.InterfaceField.PublicStaticField, 500)

o = DerivedMisc()
o.Set()
self.assertEqual(o.PublicField, 400)
Expand Down
8 changes: 4 additions & 4 deletions tests/suite/interop/net/type/test___clrtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ class X(object, metaclass=MyType):
#Shouldn't be able to use non-UInt64s
try:
x.NOT_SO_DYNAMIC = "0"
Fail("TypeError should have been thrown!")
self.fail("TypeError should have been thrown!")
except TypeError as e:
self.assertEqual(str(e),
"expected UInt64, got str")
Expand Down Expand Up @@ -710,7 +710,7 @@ def __clrtype__(self, stuff):
try:
class X(object, metaclass=MyType):
pass
Fail("Bad __clrtype__ signature!")
self.fail("Bad __clrtype__ signature!")

except TypeError as e:
self.assertEqual(str(e),
Expand Down Expand Up @@ -748,7 +748,7 @@ def __clrtype__(self):
try:
class X(object, metaclass=MyType):
pass
Fail("Arbitrary return values of __clrtype__ should not be allowed: " + str(x))
self.fail("Arbitrary return values of __clrtype__ should not be allowed: " + str(x))
except TypeError as e:
self.assertEqual(str(e),
expected_msg)
Expand All @@ -768,7 +768,7 @@ def __clrtype__(self):
try:
class X(object, metaclass=MyType):
pass
Fail("Arbitrary return values of __clrtype__ are not allowed: ", + str(x))
self.fail("Arbitrary return values of __clrtype__ are not allowed: ", + str(x))
except ValueError as e:
self.assertEqual(str(e), "__clrtype__ must return a type, not None")
finally:
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/modules/io_related/test_cPickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ def test_cp945(self):
#--sanity
try:
x = 1/0
Fail("should have been division by zero error")
self.fail("should have been division by zero error")
except Exception as e:
ex = e

Expand Down
4 changes: 2 additions & 2 deletions tests/suite/modules/io_related/test_copyreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ def test_extension_cache(self):
"The get and set of the attribute failed")

if 'cache1' not in copyreg._extension_cache or 'cache2' not in copyreg._extension_cache:
Fail("Set of the attribute failed")
self.fail("Set of the attribute failed")

copyreg.clear_extension_cache()
if 'cache1' in copyreg._extension_cache or 'cache2' in copyreg._extension_cache:
Fail("The method clear_extension_cache did not work correctly ")
self.fail("The method clear_extension_cache did not work correctly ")

def test_reconstructor(self):
reconstructor_copy = copyreg._reconstructor
Expand Down
5 changes: 3 additions & 2 deletions tests/suite/modules/misc/test_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import operator
import unittest
import sys

from iptest import IronPythonTestCase, is_cli, is_netcoreapp, big, run_test, skipUnlessIronPython

Expand Down Expand Up @@ -276,7 +277,7 @@ def pow(a,b): return a ** b
r = fnc(a,b)
except:
(exc_type, exc_value, exc_traceback) = sys.exc_info()
Fail("Binary operator failed: %s, %s: %s %s %s (Message=%s)" % (type(a).__name__, type(b).__name__, str(a), sym, str(b), str(exc_value)))
self.fail("Binary operator failed: %s, %s: %s %s %s (Message=%s)" % (type(a).__name__, type(b).__name__, str(a), sym, str(b), str(exc_value)))

threes = [ 3, big(3), 3.0 ]
zeroes = [ 0, big(0), 0.0 ]
Expand All @@ -294,7 +295,7 @@ def pow(a,b): return a ** b
pass
else:
(exc_type, exc_value, exc_traceback) = sys.exc_info()
Fail("Didn't get ZeroDivisionError %s, %s, %s, %s, %s (Message=%s)" % (str(func), type(i).__name__, type(j).__name__, str(i), str(j), str(exc_value)))
self.fail("Didn't get ZeroDivisionError %s, %s, %s, %s, %s (Message=%s)" % (str(func), type(i).__name__, type(j).__name__, str(i), str(j), str(exc_value)))

def test_unary_ops(self):
if is_cli:
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ def __getattr__(self, name): raise AttributeError('catch me')
y = x.throws
except AttributeError as ex:
self.assertEqual(ex.args, ('catch me',))
else: Fail("should have thrown")
else: self.fail("should have thrown")

def test_descriptor_meta_magic(self):
class valueDescriptor(object):
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/test_metaclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class D(C): pass
class D(C1, metaclass=dash_attributes):
pass
except TypeError: pass
else: Fail("metaclass conflict expected")
else: self.fail("metaclass conflict expected")

class D(C2, metaclass=dash_attributes):
def StartSomethingToday(self): pass
Expand Down
30 changes: 15 additions & 15 deletions tests/suite/test_python26.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as ValueError:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except IOError:
pass
self.assertEqual(ValueError, orig_ValueError)
Expand All @@ -654,7 +654,7 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as ValueError:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
finally:
pass
except IOError:
Expand Down Expand Up @@ -693,7 +693,7 @@ def test_pep3110(self):
try:
raise IOError("xyz")
except (TypeError, ValueError) as e:
Fail("IOError is not the same as TypeError or ValueError")
self.fail("IOError is not the same as TypeError or ValueError")
except IOError:
pass
self.assertEqual(e, None)
Expand All @@ -702,7 +702,7 @@ def test_pep3110(self):
try:
raise IOError("xyz")
except (TypeError, ValueError) as e:
Fail("IOError is not the same as TypeError or ValueError")
self.fail("IOError is not the same as TypeError or ValueError")
finally:
pass
except IOError:
Expand Down Expand Up @@ -745,31 +745,31 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as e:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except IOError as e:
self.assertEqual(e.args[0], "abc")
e = None

try:
raise IOError("abc")
except TypeError as e:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except IOError as e:
self.assertEqual(e.args[0], "abc")
e = None

try:
raise IOError("abc")
except TypeError as e:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except Exception as e:
self.assertEqual(e.args[0], "abc")
e = None

try:
raise IOError("abc")
except TypeError as e:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except:
pass

Expand All @@ -778,7 +778,7 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as e:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except IOError as e:
self.assertEqual(e.args[0], "abc")
e = None
Expand All @@ -787,7 +787,7 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as ValueError:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except IOError as e:
self.assertEqual(e.args[0], "abc")
e = None
Expand All @@ -796,7 +796,7 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as e:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
except IOError as e:
self.assertEqual(e.args[0], "abc")
e = None
Expand All @@ -805,7 +805,7 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as ValueError:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
finally:
pass
except Exception as e:
Expand All @@ -816,7 +816,7 @@ def test_pep3110(self):
try:
raise IOError("abc")
except TypeError as e:
Fail("IOError is not the same as TypeError")
self.fail("IOError is not the same as TypeError")
finally:
pass
except IOError:
Expand Down Expand Up @@ -964,14 +964,14 @@ def test_generatorexit(self):
try:
raise GeneratorExit()
except Exception:
Fail("Should not have caught this GeneratorExit")
self.fail("Should not have caught this GeneratorExit")
except GeneratorExit:
pass

try:
raise GeneratorExit()
except Exception:
Fail("Should not have caught this GeneratorExit")
self.fail("Should not have caught this GeneratorExit")
except GeneratorExit:
pass
finally:
Expand Down
12 changes: 6 additions & 6 deletions tests/suite/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,26 @@ def test_cp16831(self):
temp.BProperty = True
for i in range(2):
if not temp.BProperty:
Fail("Nullable Boolean was set to True")
self.fail("Nullable Boolean was set to True")
for i in range(2):
if not temp.BProperty==True:
Fail("Nullable Boolean was set to True")
self.fail("Nullable Boolean was set to True")

temp.BProperty = False
for i in range(2):
if temp.BProperty:
Fail("Nullable Boolean was set to False")
self.fail("Nullable Boolean was set to False")
for i in range(2):
if not temp.BProperty==False:
Fail("Nullable Boolean was set to False")
self.fail("Nullable Boolean was set to False")

temp.BProperty = None
for i in range(2):
if temp.BProperty:
Fail("Nullable Boolean was set to None")
self.fail("Nullable Boolean was set to None")
for i in range(2):
if not temp.BProperty==None:
Fail("Nullable Boolean was set to None")
self.fail("Nullable Boolean was set to None")

def test_cp_27434(self):
tests = {
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/test_regressions_compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_gh1357(self):
try:
clr.CompileModules(dll, filename)
except:
Fail('Failed to compile the specified file')
self.fail('Failed to compile the specified file')
finally:
os.unlink(filename)
os.unlink(dll)
Expand All @@ -46,7 +46,7 @@ def test_ipy3_gh1601(self):
try:
clr.CompileModules(dll, filename)
except:
Fail('Failed to compile the specified file')
self.fail('Failed to compile the specified file')
finally:
os.unlink(filename)
os.unlink(dll)
Expand Down
2 changes: 1 addition & 1 deletion tests/suite/test_slots.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class C(object):
def __init__(self):
try: self.b = 2
except AttributeError: pass
else: Fail("should have thrown")
else: self.fail("should have thrown")

self.assertEqual(str(C.a), "<member 'a' of 'C' objects>")

Expand Down
2 changes: 1 addition & 1 deletion tests/suite/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def ret_from_finally_x2():
except AssertionError as e:
self.assertEqual(e.args[0], "This one")
else:
Fail("Expected AssertionError, got none")
self.fail("Expected AssertionError, got none")

try:
pass
Expand Down
Loading