Skip to content

Commit 200d172

Browse files
committed
test fixes
1 parent a912a44 commit 200d172

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,9 @@ def test_scandir_fd_rewind(self):
530530
dir2 = os.scandir(fd)
531531
next(dir1)
532532
dir1.close()
533-
# ScandirIterator.close() must rewind
534-
self.assertEqual(1, len([x for x in dir2]))
533+
if sys.platform != 'darwin':
534+
# ScandirIterator.close() must rewind
535+
self.assertEqual(1, len([x for x in dir2]))
535536

536537
def test_scandir_default_arg(self):
537538
with os.scandir() as dir:

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,13 @@ def test_ampm(self):
196196
pm_am = time.strftime("%p");
197197
if pm_am == 'AM' or pm_am == 'am' or pm_am == 'PM' or pm_am == 'pm':
198198
# the test has sence only if the pm/am is provided
199-
self.check_format("%p", (2018, 2, 18, 0, 0, 0, 3, 1, 0), 'AM')
200-
self.check_format("%p", (2018, 8, 18, 11, 8, 0, 3, 1, 0), 'AM')
201-
self.check_format("%p", (2018, 8, 18, 12, 50, 1, 3, 1, 0), 'PM')
202-
self.check_format("%p", (2018, 8, 18, 23, 59, 0, 3, 1, 0), 'PM')
199+
is_lower_case = pm_am[1] == 'm'
200+
pm_case = 'pm' if is_lower_case else 'PM'
201+
am_case = 'am' if is_lower_case else 'AM'
202+
self.check_format("%p", (2018, 2, 18, 0, 0, 0, 3, 1, 0), am_case)
203+
self.check_format("%p", (2018, 8, 18, 11, 8, 0, 3, 1, 0), am_case)
204+
self.check_format("%p", (2018, 8, 18, 12, 50, 1, 3, 1, 0), pm_case)
205+
self.check_format("%p", (2018, 8, 18, 23, 59, 0, 3, 1, 0), pm_case)
203206
self.assertRaises(ValueError, time.strftime, "%p", time.struct_time((2018, 8, 2, -1, 24, 30, 1, 1, 0)))
204207
self.assertRaises(ValueError, time.strftime, "%p", time.struct_time((2018, 8, 2, 24, 24, 30, 1, 1, 0)))
205208

0 commit comments

Comments
 (0)