harder tests

This commit is contained in:
Casper da Costa-Luis 2018-04-08 22:06:19 +01:00
parent 88c301c0c2
commit a663f9647d
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
1 changed files with 9 additions and 2 deletions

View File

@ -1470,9 +1470,16 @@ def test_postfix_list():
bar_format="{postfix[0]} {postfix[1]:>5.2f}",
postfix=["foo", 42]) as t:
for i in range(10):
t.postfix = ["bar", i]
if i % 2:
t.postfix[0] = "abcdefghij"[i]
else:
t.postfix[1] = i
t.update()
assert "bar 9.00" in our_file.getvalue()
res = our_file.getvalue()
assert "f 6.00" in res
assert "h 6.00" in res
assert "h 8.00" in res
assert "j 8.00" in res
class DummyTqdmFile(object):