diff --git a/pyexcel_xls/__init__.py b/pyexcel_xls/__init__.py index 5c513bb..b890347 100644 --- a/pyexcel_xls/__init__.py +++ b/pyexcel_xls/__init__.py @@ -7,6 +7,7 @@ :copyright: (c) 2016-2021 by Onni Software Ltd :license: New BSD License """ + import xlrd # flake8: noqa diff --git a/pyexcel_xls/xlsr.py b/pyexcel_xls/xlsr.py index c9f15e8..88fe989 100644 --- a/pyexcel_xls/xlsr.py +++ b/pyexcel_xls/xlsr.py @@ -7,6 +7,7 @@ :copyright: (c) 2016-2021 by Onni Software Ltd :license: New BSD License """ + import datetime import xlrd diff --git a/pyexcel_xls/xlsw.py b/pyexcel_xls/xlsw.py index f70ec64..bbd2e67 100644 --- a/pyexcel_xls/xlsw.py +++ b/pyexcel_xls/xlsw.py @@ -7,6 +7,7 @@ :copyright: (c) 2016-2021 by Onni Software Ltd :license: New BSD License """ + import datetime import xlrd diff --git a/tests/base.py b/tests/base.py index aa7c817..1a8ef6b 100644 --- a/tests/base.py +++ b/tests/base.py @@ -81,7 +81,7 @@ def test_reading_through_sheets(self): expected = [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]] assert data == expected data = list(b["Sheet3"].rows()) - expected = [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]] + expected = [["X", "Y", "Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]] assert data == expected sheet3 = b["Sheet3"] sheet3.name_columns_by_row(0) diff --git a/tests/test_bug_fixes.py b/tests/test_bug_fixes.py index a519940..89c2464 100644 --- a/tests/test_bug_fixes.py +++ b/tests/test_bug_fixes.py @@ -8,14 +8,13 @@ import datetime from unittest.mock import MagicMock, patch +import pytest import pyexcel as pe from _compact import OrderedDict from pyexcel_xls import XLRD_VERSION_2_OR_ABOVE, save_data from pyexcel_xls.xlsr import xldate_to_python_date from pyexcel_xls.xlsw import XLSWriter as Writer -import pytest - IN_TRAVIS = "TRAVIS" in os.environ diff --git a/tests/test_multiple_sheets.py b/tests/test_multiple_sheets.py index 6708815..42b523d 100644 --- a/tests/test_multiple_sheets.py +++ b/tests/test_multiple_sheets.py @@ -1,11 +1,10 @@ import os import sys +import pytest import pyexcel from base import PyexcelMultipleSheetBase -import pytest - if sys.version_info[0] == 2 and sys.version_info[1] < 7: from ordereddict import OrderedDict else: @@ -231,6 +230,6 @@ def _produce_ordered_dict(): data_dict.update({"Sheet1": [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]]}) data_dict.update({"Sheet2": [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]]}) data_dict.update( - {"Sheet3": [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]]} + {"Sheet3": [["X", "Y", "Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]]} ) return data_dict diff --git a/tests/test_writer.py b/tests/test_writer.py index 41b7344..79759ce 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -10,7 +10,7 @@ def test_write_book(self): self.content = { "Sheet1": [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]], "Sheet2": [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]], - "Sheet3": [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]], + "Sheet3": [["X", "Y", "Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]], } self.testfile = "writer.xls" writer = Writer(self.testfile, "xls")