Skip to content
This repository was archived by the owner on May 4, 2020. It is now read-only.

Commit e9913d4

Browse files
committed
Newer testfixtures gives better feedback.
1 parent 342ab10 commit e9913d4

File tree

2 files changed

+37
-13
lines changed

2 files changed

+37
-13
lines changed

docs/view.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ data in the view of the sheet is not as expected:
7777
... )
7878
Traceback (most recent call last):
7979
...
80-
AssertionError: Sequence not as expected:
80+
AssertionError: sequence not as expected:
8181
<BLANKLINE>
8282
same:
8383
(('R0C0',),)
@@ -86,7 +86,18 @@ first:
8686
(('R0C1',),)
8787
<BLANKLINE>
8888
second:
89-
((u'R1C0',), (u'A merged cell',), ('',), ('',), (u'More merged cells',))
89+
((u'R1C0',), (u'A merged cell',), (u'',), (u'',), (u'More merged cells',))
90+
<BLANKLINE>
91+
While comparing [1]: sequence not as expected:
92+
<BLANKLINE>
93+
same:
94+
()
95+
<BLANKLINE>
96+
first:
97+
('R0C1',)
98+
<BLANKLINE>
99+
second:
100+
(u'R1C0',)
90101

91102
Use of the :meth:`~CheckSheet.compare` method requires
92103
`testfixtures`__ to be installed.

xlutils/tests/test_view.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,18 @@ def test_matches(self):
156156

157157

158158
def test_does_not_match(self):
159-
with ShouldRaise(AssertionError('''\
160-
Sequence not as expected:
159+
with ShouldRaise(AssertionError) as s:
160+
CheckerView(path.join(test_files,'testall.xls'))['Sheet1'].compare(
161+
(u'R0C0', u'R0C1'),
162+
(u'R1C0', u'R1C1'),
163+
(u'A merged cell', ''),
164+
('', ''),
165+
('', ''),
166+
(u'More merged cells', 'XX')
167+
)
168+
169+
compare(str(s.raised), expected='''\
170+
sequence not as expected:
161171
162172
same:
163173
((u'R0C0', u'R0C1'),
@@ -170,12 +180,15 @@ def test_does_not_match(self):
170180
((u'More merged cells', 'XX'),)
171181
172182
second:
173-
((u'More merged cells', ''),)''')):
174-
CheckerView(path.join(test_files,'testall.xls'))['Sheet1'].compare(
175-
(u'R0C0', u'R0C1'),
176-
(u'R1C0', u'R1C1'),
177-
(u'A merged cell', ''),
178-
('', ''),
179-
('', ''),
180-
(u'More merged cells', 'XX')
181-
)
183+
((u'More merged cells', u''),)
184+
185+
While comparing [5]: sequence not as expected:
186+
187+
same:
188+
(u'More merged cells',)
189+
190+
first:
191+
('XX',)
192+
193+
second:
194+
(u'',)''')

0 commit comments

Comments
 (0)