Skip to content
Merged
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
5 changes: 3 additions & 2 deletions tests/python/test_pythonmonkey_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ def test_eval_dates():
end = start + timedelta(days=365 * years)
for _ in range(10):
py_date = start + (end - start) * random.random()
py_date = py_date.replace(microsecond=0)
js_date = pm.eval(f'new Date({py_date.year}, {py_date.month - 1}, {py_date.day}, {py_date.hour}, {py_date.minute}, {py_date.second}, {py_date.microsecond / 1000})')
# round to milliseconds precision because the smallest unit for js Date is 1ms
py_date = py_date.replace(microsecond=round(py_date.microsecond, -3))
js_date = pm.eval(f'new Date("{py_date.isoformat()}")')
assert py_date == js_date

def test_eval_boxed_booleans():
Expand Down