Skip to content

Commit

Permalink
ensured twanager errors are silenced in tests
Browse files Browse the repository at this point in the history
these errors are expected, so we don't want to suggest something went
wrong when it didn't

note that this is a rather crude workaround
  • Loading branch information
FND committed Sep 26, 2013
1 parent ec7fc07 commit 35e0fb3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def teardown_module(module):

def test_assetcopy(): # XXX: does not belong here
target_dir = os.path.join(TMPDIR, 'static_assets')
# capture STDERR to avoid confusion -- XXX: might interefere with reporting - belongs into setup/teardown
stderr = sys.stderr
from StringIO import StringIO
sys.stderr = StringIO()

with raises(SystemExit): # no directory provided
handle(['', 'assetcopy'])
Expand All @@ -82,6 +86,8 @@ def test_assetcopy(): # XXX: does not belong here
with raises(SystemExit): # directory already exists
handle(['', 'assetcopy', target_dir])

sys.stderr = stderr # restore


def test_root():
response, content = _req('GET', '/')
Expand Down

0 comments on commit 35e0fb3

Please sign in to comment.