Skip to content

Commit

Permalink
adding test for assert_docker()
Browse files Browse the repository at this point in the history
  • Loading branch information
lockefox committed Mar 25, 2018
1 parent 76d8db8 commit a67c35f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 2 additions & 4 deletions prosper/common/test_helpers.py
Expand Up @@ -31,8 +31,6 @@ def assert_docker(xfail=False, force_retry=False, **kwargs):
return

if xfail:
raise pytest.xfail(
'Docker Not available: {!r}'.format(err) # TODO: this seems bad af
)
raise pytest.xfail('Docker Not available:')
else:
raise exceptions.DockerNotFound(repr(err))
raise exceptions.DockerNotFound()
18 changes: 18 additions & 0 deletions tests/test_test_helpers.py
@@ -0,0 +1,18 @@
"""who tests the tester's tests?"""
import pytest
import _pytest.outcomes

import prosper.common.test_helpers as p_helpers
import prosper.common.exceptions as exceptions

def test_assert_docker_regular():
"""make sure p_helpers.assert_docker() raises expected error"""
p_helpers.DOCKER_OK = False
with pytest.raises(exceptions.DockerNotFound):
p_helpers.assert_docker()

def test_assert_docker_xfail():
"""make sure p_helpers.assert_docker() raises xfail in mode"""
p_helpers.DOCKER_OK = False
with pytest.raises(_pytest.outcomes.XFailed):
p_helpers.assert_docker(xfail=True)

0 comments on commit a67c35f

Please sign in to comment.