Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29fb393

Browse files
committed
better error
1 parent 21bb833 commit 29fb393

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

11_bottles_of_beer/test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ def test_usage():
3131
def test_bad_int():
3232
"""Bad integer value"""
3333

34-
rv, out = getstatusoutput(f'{prg} -n -1')
34+
bad = random.randint(-10, -1)
35+
rv, out = getstatusoutput(f'{prg} -n {bad}')
3536
assert rv != 0
36-
assert re.search(r'--num \(-1\) must > 0', out)
37+
assert re.search(f'--num "{bad}" must be greater than 0', out)
3738

3839

3940
# --------------------------------------------------

0 commit comments

Comments
 (0)