Skip to content

Commit 3429ff5

Browse files
committed
format
1 parent e9cb516 commit 3429ff5

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

pyexcel_ods/odsr.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
:copyright: (c) 2014-2020 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
10+
1011
# Copyright 2011 Marco Conti
1112

1213
# Licensed under the Apache License, Version 2.0 (the "License");

pyexcel_ods/odsw.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
:copyright: (c) 2014-2020 by Onni Software Ltd.
88
:license: New BSD License, see LICENSE for more details
99
"""
10+
1011
import pyexcel_io.service as converter
1112
from odf.text import P
1213
from odf.table import Table, TableRow, TableCell

tests/base.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os # noqa
22
import datetime # noqa
33

4+
import pytest
45
import pyexcel
56

6-
import pytest
77

88
def create_sample_file1(file):
99
data = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", 1.1, 1]
@@ -82,7 +82,7 @@ def test_reading_through_sheets(self):
8282
expected = [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]]
8383
assert data == expected
8484
data = list(b["Sheet3"].rows())
85-
expected = [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]]
85+
expected = [["X", "Y", "Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]]
8686
assert data == expected
8787
sheet3 = b["Sheet3"]
8888
sheet3.name_columns_by_row(0)
@@ -105,9 +105,9 @@ def test_formats(self):
105105
assert self.data["Sheet1"][1][1].strftime(time_format) == "12:12:11"
106106
assert self.data["Sheet1"][2][1].strftime(time_format) == "12:00:00"
107107
assert self.data["Sheet1"][3][1] == 0
108-
assert (
109-
self.data["Sheet1"][4][1] ==
110-
datetime.timedelta(hours=27, minutes=17, seconds=54))
108+
assert self.data["Sheet1"][4][1] == datetime.timedelta(
109+
hours=27, minutes=17, seconds=54
110+
)
111111
assert self.data["Sheet1"][5][1] == "Other"
112112
# boolean
113113
assert self.data["Sheet1"][0][2] == "Boolean"

tests/test_bug_fixes.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import os
44

55
import psutil
6+
import pytest
67
import pyexcel as pe
78
from pyexcel_ods import get_data, save_data
89
from pyexcel_io.exceptions import IntegerAccuracyLossError
910

10-
import pytest
11-
1211
IN_TRAVIS = "TRAVIS" in os.environ
1312

1413

@@ -20,10 +19,10 @@ def test_bug_fix_for_issue_1():
2019
def test_bug_fix_for_issue_2():
2120
data = {}
2221
data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]})
23-
data.update({"Sheet 2": [[u"row 1", u"Héllô!", u"HolÁ!"]]})
22+
data.update({"Sheet 2": [["row 1", "Héllô!", "HolÁ!"]]})
2423
save_data("your_file.ods", data)
2524
new_data = get_data("your_file.ods")
26-
assert new_data["Sheet 2"] == [[u"row 1", u"H\xe9ll\xf4!", u"Hol\xc1!"]]
25+
assert new_data["Sheet 2"] == [["row 1", "H\xe9ll\xf4!", "Hol\xc1!"]]
2726

2827

2928
def test_invalid_date():
@@ -33,7 +32,6 @@ def test_invalid_date():
3332
value = "2015-08-"
3433
date_value(value)
3534

36-
3735
with pytest.raises(Exception):
3836
from pyexcel_ods.ods import date_value
3937

@@ -67,7 +65,7 @@ def test_issue_14():
6765
# pyexcel issue 61
6866
test_file = "issue_61.ods"
6967
data = get_data(get_fixtures(test_file), skip_empty_rows=True)
70-
assert data["S-LMC"] == [[u"aaa"], [0]]
68+
assert data["S-LMC"] == [["aaa"], [0]]
7169

7270

7371
def test_issue_6():
@@ -114,7 +112,9 @@ def test_issue_83_ods_file_handle():
114112
def test_pr_22():
115113
test_file = get_fixtures("white_space.ods")
116114
data = get_data(test_file)
117-
assert data["Sheet1"][0][0] == "paragraph with tab(\t), space, \nnew line"
115+
assert (
116+
data["Sheet1"][0][0] == "paragraph with tab(\t), space, \nnew line"
117+
)
118118

119119

120120
def test_issue_23():

tests/test_multiple_sheets.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import os
22
import sys
33

4+
import pytest
45
import pyexcel
56
from base import PyexcelMultipleSheetBase
67

7-
import pytest
8-
98
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
109
from ordereddict import OrderedDict
1110
else:
@@ -241,6 +240,6 @@ def _produce_ordered_dict():
241240
data_dict.update({"Sheet1": [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]]})
242241
data_dict.update({"Sheet2": [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]]})
243242
data_dict.update(
244-
{"Sheet3": [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]]}
243+
{"Sheet3": [["X", "Y", "Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]]}
245244
)
246245
return data_dict

tests/test_writer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def test_write_book(self):
1010
self.content = {
1111
"Sheet1": [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]],
1212
"Sheet2": [[4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]],
13-
"Sheet3": [[u"X", u"Y", u"Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]],
13+
"Sheet3": [["X", "Y", "Z"], [1, 4, 7], [2, 5, 8], [3, 6, 9]],
1414
}
1515
self.testfile = "writer.ods"
1616
writer = Writer(self.testfile, "ods")

0 commit comments

Comments
 (0)