Fixed a bug in test_intl.py: teardown didn't get called if the test was skipped

This commit is contained in:
Tim Martin
2011-04-17 00:22:10 +01:00
parent 9b112e0619
commit 4fb8139f36

View File

@@ -25,6 +25,11 @@ def setup_module():
test_root / 'xx' / 'LC_MESSAGES' / '%s.mo' % catalog],
stdout=PIPE, stderr=PIPE)
except OSError:
# The test will fail the second time it's run if we don't
# tear down here. Not sure if there's a more idiomatic way
# of ensuring that teardown gets run in the event of an
# exception from the setup function.
teardown_module()
raise SkipTest # most likely msgfmt was not found
else:
stdout, stderr = p.communicate()