Skip to content

Commit

Permalink
Fix tox tests so they will actually fail
Browse files Browse the repository at this point in the history
As things stand, the tests never fail when run via tox.
`__main__.py` runs each individual test script, but always exits
0, even if a test script exits >0.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
  • Loading branch information
AdamWill committed Jul 8, 2022
1 parent 2382432 commit 4cb65de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 8 additions & 3 deletions dill/tests/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@

if __name__ == '__main__':

failed = 0
for test in tests:
p = sp.Popen([python, test], shell=shell).wait()
if not p:
print('.', end='', flush=True)
print()
if p:
print('F', end='')
failed = 1
else:
print('.', end='')
print('')
exit(failed)
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ whitelist_externals =
bash
commands =
{envpython} -m pip install .
bash -c "failed=0; for test in dill/tests/__main__.py; do echo $test; \
{envpython} $test || failed=1; done; exit $failed"
{envpython} dill/tests/__main__.py

0 comments on commit 4cb65de

Please sign in to comment.