Add spec=[] to two mock functions in tests.
This commit is contained in:
parent
1e1335aa5e
commit
81f5b7115f
@ -37,7 +37,7 @@ def test_first_last_item(counts):
|
|||||||
model = completionmodel.CompletionModel()
|
model = completionmodel.CompletionModel()
|
||||||
for c in counts:
|
for c in counts:
|
||||||
cat = mock.Mock(spec=['layoutChanged'])
|
cat = mock.Mock(spec=['layoutChanged'])
|
||||||
cat.rowCount = mock.Mock(return_value=c)
|
cat.rowCount = mock.Mock(return_value=c, spec=[])
|
||||||
model.add_category(cat)
|
model.add_category(cat)
|
||||||
nonempty = [i for i, rowCount in enumerate(counts) if rowCount > 0]
|
nonempty = [i for i, rowCount in enumerate(counts) if rowCount > 0]
|
||||||
if not nonempty:
|
if not nonempty:
|
||||||
@ -61,7 +61,7 @@ def test_count(counts):
|
|||||||
model = completionmodel.CompletionModel()
|
model = completionmodel.CompletionModel()
|
||||||
for c in counts:
|
for c in counts:
|
||||||
cat = mock.Mock(spec=['rowCount', 'layoutChanged'])
|
cat = mock.Mock(spec=['rowCount', 'layoutChanged'])
|
||||||
cat.rowCount = mock.Mock(return_value=c)
|
cat.rowCount = mock.Mock(return_value=c, spec=[])
|
||||||
model.add_category(cat)
|
model.add_category(cat)
|
||||||
assert model.count() == sum(counts)
|
assert model.count() == sum(counts)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user