Skip to content

Commit

Permalink
Replace deprecated datetime calls
Browse files Browse the repository at this point in the history
  • Loading branch information
lognaturel committed Sep 5, 2024
1 parent d3cba1f commit b62c0d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_xls2json_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Test xls2json_backends module functionality.
"""

import datetime
import os
from datetime import datetime
from unittest import TestCase

import openpyxl
Expand Down Expand Up @@ -81,9 +81,9 @@ def test_xls_with_many_empty_cells(self):
self.maxDiff = None
# Test fixture produced by adding data at cells IV1 and A19999.
xls_path = os.path.join(bug_example_xls.PATH, "extra_columns.xls")
before = datetime.utcnow()
before = datetime.datetime.now(datetime.timezone.utc)
xls_data = xls_to_dict(xls_path)
after = datetime.utcnow()
after = datetime.datetime.now(datetime.timezone.utc)
self.assertLess((after - before).total_seconds(), 5)
wb = xlrd.open_workbook(filename=xls_path)

Expand All @@ -105,9 +105,9 @@ def test_xlsx_with_many_empty_cells(self):
self.maxDiff = None
# Test fixture produced (presumably) by a LibreOffice serialisation bug.
xlsx_path = os.path.join(bug_example_xls.PATH, "UCL_Biomass_Plot_Form.xlsx")
before = datetime.utcnow()
before = datetime.datetime.now(datetime.timezone.utc)
xlsx_data = xlsx_to_dict(xlsx_path)
after = datetime.utcnow()
after = datetime.datetime.now(datetime.timezone.utc)
self.assertLess((after - before).total_seconds(), 5)
wb = openpyxl.open(filename=xlsx_path, read_only=True, data_only=True)

Expand Down

0 comments on commit b62c0d8

Please sign in to comment.