Fix atts_assign results for Windows
Assigning Max32BitInt+1 to and int on Windows causes TypeError not ValueError.
Change expected results for Windows in those cases.
#
# Mark C. Miller, Tue Jun 8 15:51:59 PDT 2021
#
+# Modifications:
+# Kathleen Biagas, Tue July 27, 2021
+# Assigning Max32BitInt+1 to int on Windows causes TypeError, not
+# ValueError, so change expected results in those cases.
+#
# ----------------------------------------------------------------------------
import copy, io, sys
@@ -198,6 +203,9 @@ def TestAssignmentToInt():
pass
fails = [ '123', 1+2j, None, X, Max32BitInt1]
+ if sys.platform.startswith("win"):
+ excpts = [TypeError, TypeError, TypeError, TypeError, TypeError]
+ else:
excpts = [TypeError, TypeError, TypeError, TypeError, ValueError]
for i in range(len(fails)):
try:
@@ -566,6 +574,10 @@ def TestAssignmentToIntVector():
fails = [(Max32BitInt1,), (1+2j,), ('b',), (None,), (1,Max32BitInt1,3),
(1,1+2j,3), (1,X,3), (1,'b',3), (1,None,3)]
+ if sys.platform.startswith("win"):
+ excpts = [TypeError, TypeError, TypeError, TypeError, TypeError,
+ TypeError, TypeError, TypeError, TypeError]
+ else:
excpts = [ValueError, TypeError, TypeError, TypeError, ValueError,
TypeError, TypeError, TypeError, TypeError]
for i in range(len(fails)):
@@ -797,8 +809,12 @@ def TestAssignmentToIntArray():
TestFOA('ra.reflections=0,1,0,1,0,1,0,1', LINE())
pass
- fails = [(0,1,None,1,0,1,0,1), (0,1,1+2j,1,0,1,0,1), (0,1,X,1,0,1,0,1), (0,1,Max32BitInt1,1,0,1,0,1),
- (0,1,'123',1,0,1,0,1), (0,1,0,1,0,1,0,1,1), (0,1,0,1,0,1,0)]
+ fails = [(0,1,None,1,0,1,0,1), (0,1,1+2j,1,0,1,0,1), (0,1,X,1,0,1,0,1),
+ (0,1,Max32BitInt1,1,0,1,0,1), (0,1,'123',1,0,1,0,1),
+ (0,1,0,1,0,1,0,1,1), (0,1,0,1,0,1,0)]
+ if sys.platform.startswith("win"):
+ excpts = [TypeError, TypeError, TypeError, TypeError, TypeError, TypeError, TypeError]
+ else:
excpts = [TypeError, TypeError, TypeError, ValueError, TypeError, TypeError, TypeError]
for i in range(len(fails)):
try:
