Skip to content

Commit 31470af

Browse files
author
Steve Canny
committed
py3: last few tweaks to get clean tox run
* Python 3 doesn't like the relative import of helpers * neglected to open test stream in binary mode
1 parent 259fcfd commit 31470af

File tree

7 files changed

+7
-14
lines changed

7 files changed

+7
-14
lines changed

features/steps/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from docx.shared import Inches
1010
from docx.table import Table
1111

12-
from .helpers import test_file_path
12+
from helpers import test_file_path
1313

1414

1515
# when ====================================================

features/steps/block.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from docx import Document
1010
from docx.table import Table
1111

12-
from .helpers import test_docx
12+
from helpers import test_docx
1313

1414

1515
# given ===================================================

features/steps/paragraph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from docx import Document
1010

11-
from .helpers import saved_docx_path, test_text
11+
from helpers import saved_docx_path, test_text
1212

1313
test_style = 'Heading1'
1414

features/steps/shape.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from docx.parts.document import InlineShape, InlineShapes
1616
from docx.shared import Inches
1717

18-
from .helpers import test_docx, test_file_path
18+
from helpers import test_docx, test_file_path
1919

2020

2121
# given ===================================================
@@ -58,7 +58,7 @@ def given_inline_shape_known_to_be_shape_of_type(context, shp_of_type):
5858
@when('I add an inline picture from a file-like object')
5959
def when_add_inline_picture_from_file_like_object(context):
6060
document = context.document
61-
with open(test_file_path('monty-truth.png')) as f:
61+
with open(test_file_path('monty-truth.png'), 'rb') as f:
6262
context.inline_shape = document.inline_shapes.add_picture(f)
6363

6464

features/steps/shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from docx import Document
1212

13-
from .helpers import saved_docx_path
13+
from helpers import saved_docx_path
1414

1515

1616
# given ===================================================

features/steps/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
_Cell, _Column, _ColumnCells, _Columns, _Row, _RowCells, _Rows
1414
)
1515

16-
from .helpers import test_docx
16+
from helpers import test_docx
1717

1818

1919
# given ===================================================

tox.ini

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
#
2-
# tox.ini
3-
#
4-
# Copyright (C) 2012, 2013 Steve Canny scanny@cisco.com
5-
#
6-
# This module is part of python-docx and is released under the MIT License:
7-
# http://www.opensource.org/licenses/mit-license.php
8-
#
92
# Configuration for tox and pytest
103

114
[pytest]

0 commit comments

Comments
 (0)