Skip to content

Commit 4c15059

Browse files
committed
More PEP 8 fixes
1 parent 165bfa1 commit 4c15059

4 files changed

+25
-17
lines changed

tests/test_issue72_epc_encoding_name.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ def test_valid_encoding(encoding, number):
3434
assert qr
3535

3636

37-
@pytest.mark.parametrize('encoding', ('utf-16', 'iso-8859-6', 'ascii', 'something'))
37+
@pytest.mark.parametrize('encoding', ('utf-16', 'iso-8859-6', 'ascii',
38+
'something'))
3839
def test_illegal_encoding(encoding):
3940
kw = _make_valid_kw()
4041
kw['encoding'] = encoding

tests/test_issue84_cli_encoding.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818

1919
def test_issue_84_default_encoding():
20-
with open(os.path.join(os.path.dirname(__file__), 'issue-84', 'issue-84-iso-8859-1.txt'), 'r') as f:
20+
with open(os.path.join(os.path.dirname(__file__), 'issue-84',
21+
'issue-84-iso-8859-1.txt'), 'r') as f:
2122
expected = f.read()
2223
f = tempfile.NamedTemporaryFile('w', suffix='.txt', delete=False)
2324
f.close()
@@ -41,7 +42,8 @@ def test_issue_84_default_encoding():
4142

4243

4344
def test_issue_84_utf8():
44-
with open(os.path.join(os.path.dirname(__file__), 'issue-84', 'issue-84-utf-8.txt'), 'r') as f:
45+
with open(os.path.join(os.path.dirname(__file__), 'issue-84',
46+
'issue-84-utf-8.txt'), 'r') as f:
4547
expected = f.read()
4648
f = tempfile.NamedTemporaryFile('w', suffix='.txt', delete=False)
4749
f.close()

tests/test_output.py

+17-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
from .test_ppm import ppm_bw_as_matrix
2525
from .test_tex import tex_as_matrix
2626
from .test_xpm import xpm_as_matrix
27-
except (ValueError, SystemError, ImportError): # Attempted relative import in non-package
27+
# Attempted relative import in non-package
28+
except (ValueError, SystemError, ImportError):
2829
from test_eps import eps_as_matrix
2930
from test_png import png_as_matrix
3031
from test_svg import svg_as_matrix
@@ -50,22 +51,25 @@
5051

5152

5253
def _make_test_data_input():
53-
for kind, buffer_factory, to_matrix_func, kw in (('eps', io.StringIO, eps_as_matrix, {}),
54-
('png', io.BytesIO, png_as_matrix, {}),
55-
('svg', io.BytesIO, svg_as_matrix, {}),
56-
('txt', io.StringIO, txt_as_matrix, {}),
57-
('pdf', io.BytesIO, pdf_as_matrix, {}),
58-
('ans', io.StringIO, terminal_as_matrix, {}),
59-
('tex', io.StringIO, tex_as_matrix, {}),
60-
('xpm', io.StringIO, xpm_as_matrix, {}),
61-
('pam', io.BytesIO, pam_bw_as_matrix, {}),
62-
('pbm', io.BytesIO, pbm_p1_as_matrix, dict(plain=True)),
63-
('ppm', io.BytesIO, ppm_bw_as_matrix, {}),):
54+
for kind, buffer_factory, to_matrix_func, kw in (
55+
('eps', io.StringIO, eps_as_matrix, {}),
56+
('png', io.BytesIO, png_as_matrix, {}),
57+
('svg', io.BytesIO, svg_as_matrix, {}),
58+
('txt', io.StringIO, txt_as_matrix, {}),
59+
('pdf', io.BytesIO, pdf_as_matrix, {}),
60+
('ans', io.StringIO, terminal_as_matrix, {}),
61+
('tex', io.StringIO, tex_as_matrix, {}),
62+
('xpm', io.StringIO, xpm_as_matrix, {}),
63+
('pam', io.BytesIO, pam_bw_as_matrix, {}),
64+
('pbm', io.BytesIO, pbm_p1_as_matrix, dict(plain=True)),
65+
('ppm', io.BytesIO, ppm_bw_as_matrix, {}),
66+
):
6467
for data, error, border in _DATA:
6568
yield kind, buffer_factory, to_matrix_func, data, error, border, kw
6669

6770

68-
@pytest.mark.parametrize('kind, buffer_factory, to_matrix_func, data, error, border, kw',
71+
@pytest.mark.parametrize('kind, buffer_factory, to_matrix_func, data, error, '
72+
'border, kw',
6973
_make_test_data_input())
7074
def test_data(kind, buffer_factory, to_matrix_func, data, error, border, kw):
7175
# Creates a QR Code, serializes it and checks if the serialization

tests/test_pbm.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def pbm_p1_as_matrix(buff, border):
6767
res = []
6868
code_iter, len_without_border = _move_to_raster(buff, border)
6969
for line in islice(code_iter, border, len_without_border):
70-
row = [int(i) for i in islice(line.decode('ascii'), border, len_without_border)]
70+
row = [int(i) for i in islice(line.decode('ascii'), border,
71+
len_without_border)]
7172
res.append(row)
7273
return res
7374

0 commit comments

Comments
 (0)