nose-devs/nose — pull request #597 by mitya57 (2013-01-11 10:30:22+00:00)
Title: test_coverage_plugin.py: raise SkipTest when coverage cannot be imported

Currently, when coverage is not available, `selftest.py` raises the following errors:

```
======================================================================
FAIL: runTest (test_coverage_plugin.TestCoverageMinPercentagePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mandriver/tests/nose/nose.vanilla/build/tests/functional_tests/test_coverage_plugin.py", line 51, in setUp
super(TestCoverageMinPercentagePlugin, self).setUp)
AssertionError: AssertionError: SystemExit not raised by setUp
-------------------- >> begin captured stdout << ---------------------
hi

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: runTest (test_coverage_plugin.TestCoverageMinPercentageTOTALPlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mandriver/tests/nose/nose.vanilla/build/tests/functional_tests/test_coverage_plugin.py", line 72, in setUp
super(TestCoverageMinPercentageTOTALPlugin, self).setUp)
AssertionError: AssertionError: SystemExit not raised by setUp
-------------------- >> begin captured stdout << ---------------------
hi

--------------------- >> end captured stdout << ----------------------

======================================================================
FAIL: runTest (test_coverage_plugin.TestCoveragePlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/mandriver/tests/nose/nose.vanilla/build/tests/functional_tests/test_coverage_plugin.py", line 28, in runTest
self.assertTrue("blah 4 3 25% 1" in self.output)
AssertionError: AssertionError: False is not true
-------------------- >> begin captured stdout << ---------------------
hi

--------------------- >> end captured stdout << ----------------------
```

This commit makes the coverage tests skipped when coverage is not available (as suggested by @jszakmeister in [#580](https://github.com/nose-devs/nose/issues/580#issuecomment-10509342)).