Skip to content

Commit b8091c2

Browse files
committed
cleanup whitespace
1 parent c25ee65 commit b8091c2

File tree

1 file changed

+21
-23
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests

1 file changed

+21
-23
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_int.py

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,29 @@ def test_int_subclassing():
6060
MAXREPEAT = _NamedIntConstant(1, 'MAXREPEAT')
6161
assert MAXREPEAT == 1
6262
assert str(MAXREPEAT) == "MAXREPEAT"
63-
63+
6464

6565
def test_boolean2int():
6666
assert int(True) == 1
6767
assert int(False) == 0
68-
69-
68+
69+
7070
def test_int_from_custom():
7171
class CustomInt4():
7272
def __int__(self):
7373
return 1
74-
74+
7575
class CustomInt8():
7676
def __int__(self):
7777
return 0xCAFEBABECAFED00D
78-
78+
7979
class SubInt(int):
8080
def __int__(self):
8181
return 0xBADF00D
82-
82+
8383
class NoInt():
8484
pass
85-
85+
8686
assert int(CustomInt4()) == 1
8787
assert int(CustomInt8()) == 0xCAFEBABECAFED00D
8888
assert CustomInt8() != 0xCAFEBABECAFED00D
@@ -124,7 +124,7 @@ def builtinTest(number):
124124
builtinTest(9)
125125
builtinTest(6227020800)
126126
builtinTest(9999992432902008176640000999999)
127-
127+
128128
assert True.__int__() == 1
129129
assert False.__int__() == 0
130130

@@ -161,13 +161,13 @@ def builtinTest(number):
161161
builtinTest(9)
162162
builtinTest(6227020800)
163163
builtinTest(9999992432902008176640000999999)
164-
164+
165165
assert True.real == 1
166166
assert False.real == 0
167167
assert True.imag == 0
168168
assert False.imag == 0
169169

170-
def test_real_imag_subclass():
170+
def test_real_imag_subclass():
171171
def subclassTest(number):
172172
a = MyInt(number)
173173
b = a.real
@@ -202,7 +202,7 @@ def builtinTest(number):
202202
builtinTest(9)
203203
builtinTest(6227020800)
204204
builtinTest(9999992432902008176640000999999)
205-
205+
206206
assert True.numerator == 1
207207
assert False.numerator == 0
208208
assert True.denominator == 1
@@ -240,7 +240,7 @@ def builtinTest(number):
240240
builtinTest(9)
241241
builtinTest(6227020800)
242242
builtinTest(9999992432902008176640000999999)
243-
243+
244244
assert True.conjugate() == 1
245245
assert False.conjugate() == 0
246246

@@ -282,7 +282,7 @@ def builtinTest(number):
282282
builtinTest(9)
283283
builtinTest(6227020800)
284284
builtinTest(9999992432902008176640000999999)
285-
285+
286286
assert True.__trunc__() == 1
287287
assert False.__trunc__() == 0
288288

@@ -325,7 +325,7 @@ def test_create_int_from_string():
325325

326326

327327
class FromBytesTests(unittest.TestCase):
328-
328+
329329
def check(self, tests, byteorder, signed=False):
330330
for test, expected in tests.items():
331331
try:
@@ -447,10 +447,10 @@ def test_from_list(self):
447447
class LyingList(list):
448448
def __iter__(self):
449449
return iter([10, 20, 30, 40])
450-
450+
451451
self.assertEqual(
452452
int.from_bytes(LyingList([255, 1, 1]), 'big'), 169090600)
453-
453+
454454
def test_from_tuple(self):
455455
self.assertEqual(
456456
int.from_bytes((255, 0, 0), 'big', signed=True), -65536)
@@ -464,7 +464,7 @@ def __iter__(self):
464464
return iter((15, 25, 35, 45))
465465
self.assertEqual(
466466
int.from_bytes(LyingTuple((255, 1, 1)), 'big'), 253305645)
467-
467+
468468
def test_from_bytearray(self):
469469
self.assertEqual(int.from_bytes(
470470
bytearray(b'\xff\x00\x00'), 'big', signed=True), -65536)
@@ -549,7 +549,7 @@ class mybyteslike2():
549549
def __bytes__(self):
550550
return array.array('b', [2, 2, 3])
551551

552-
self.assertRaises(TypeError, int.from_bytes, mybyteslike2(), 'big')
552+
self.assertRaises(TypeError, int.from_bytes, mybyteslike2(), 'big')
553553

554554
def test_from_list_with_byteslike(self):
555555
class StrangeList(list):
@@ -563,7 +563,7 @@ def __iter__(self):
563563
class ToBytesTests(unittest.TestCase):
564564

565565
class MyInt(int):
566-
pass
566+
pass
567567

568568
def check(self, tests, byteorder, signed=False):
569569
for test, expected in tests.items():
@@ -633,7 +633,7 @@ def test_SignedLittleEndian(self):
633633
}
634634
self.check(tests2, 'little', signed=True)
635635
self.checkPIntSpec(tests2, 'little', signed=True)
636-
636+
637637
def test_UnsignedBigEndian(self):
638638
# Convert integers to unsigned big-endian byte arrays.
639639
tests3 = {
@@ -705,7 +705,5 @@ def __int__(self):
705705
return 3
706706
def __index__(self):
707707
return 4
708-
709-
self.assertEqual(MyTest(1).to_bytes(MyTest(10), 'big'), b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')
710-
711708

709+
self.assertEqual(MyTest(1).to_bytes(MyTest(10), 'big'), b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01')

0 commit comments

Comments
 (0)