Skip to content

Commit 115c8bd

Browse files
committed
Show breaking test
test_decimal fails because its contents, a zip object, are exhausted by a previous test. Reproduce by seeing a pass then a fail when running pytest -k 'test_offset or test_decimal' tests/test_fetch.py
1 parent 30174bc commit 115c8bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_fetch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def test_offset(self, schema_any, lang, languages):
215215
assert len(cur) == 4, "Length is not correct"
216216
for c, l in list(zip(cur, languages[1:]))[:4]:
217217
assert np.all([cc == ll for cc, ll in zip(c, l)]), "Sorting order is different"
218+
assert len(schema.DecimalPrimaryKey().fetch()), "Table DecimalPrimaryKey is empty"
218219

219220
def test_limit_warning(self, schema_any, lang):
220221
"""Tests whether warning is raised if offset is used without limit."""
@@ -257,7 +258,7 @@ def test_fetch1_step3(self, schema_any, lang):
257258
def test_decimal(self, schema_any):
258259
"""Tests that decimal fields are correctly fetched and used in restrictions, see issue #334"""
259260
rel = schema.DecimalPrimaryKey()
260-
assert bool(schema.DecimalPrimaryKey().fetch()), "Table DecimalPrimaryKey is empty"
261+
assert len(rel.fetch()), "Table DecimalPrimaryKey contents are empty"
261262
rel.insert1([decimal.Decimal("3.1415926")])
262263
keys = rel.fetch()
263264
assert len(keys) > 0

0 commit comments

Comments
 (0)