summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-06-12 09:25:44 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-06-12 09:25:44 -0400
commit785a0d6b37fd1526799791a2b39dfcdead0ab9a0 (patch)
tree61ca652e5fb6c75f58636ff129fd79aac1842318 /tests
parent55d6b82324568c4fc61134c049875d3085721c0f (diff)
downloadpython-coveragepy-785a0d6b37fd1526799791a2b39dfcdead0ab9a0.tar.gz
Use standard skipTest, which unittest-mixins will override.
Diffstat (limited to 'tests')
-rw-r--r--tests/coveragetest.py7
-rw-r--r--tests/test_api.py4
-rw-r--r--tests/test_arcs.py10
-rw-r--r--tests/test_coverage.py4
-rw-r--r--tests/test_files.py2
-rw-r--r--tests/test_parser.py2
-rw-r--r--tests/test_phystokens.py2
-rw-r--r--tests/test_plugins.py4
-rw-r--r--tests/test_process.py14
-rw-r--r--tests/test_summary.py4
10 files changed, 23 insertions, 30 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py
index b38e0a5..ae2a387 100644
--- a/tests/coveragetest.py
+++ b/tests/coveragetest.py
@@ -24,8 +24,6 @@ from coverage.backward import StringIO, import_local_file, string_class, shlex_q
from coverage.cmdline import CoverageScript
from coverage.debug import _TEST_NAME_FILE, DebugControl
-from nose.plugins.skip import SkipTest
-
from tests.helpers import run_command
@@ -62,11 +60,6 @@ class CoverageTest(
self.__class__.__name__, self._testMethodName,
))
- def skip(self, reason):
- """Skip this test, and give a reason."""
- self.class_behavior().skipped += 1
- raise SkipTest(reason)
-
def clean_local_file_imports(self):
"""Clean up the results of calls to `import_local_file`.
diff --git a/tests/test_api.py b/tests/test_api.py
index f4ab2ba..4ee99a1 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -282,7 +282,7 @@ class ApiTest(CoverageTest):
self.check_code1_code2(cov)
def test_start_save_stop(self):
- self.skip("Expected failure: https://bitbucket.org/ned/coveragepy/issue/79")
+ self.skipTest("Expected failure: https://bitbucket.org/ned/coveragepy/issue/79")
self.make_code1_code2()
cov = coverage.Coverage()
cov.start()
@@ -331,7 +331,7 @@ class NamespaceModuleTest(CoverageTest):
def setUp(self):
super(NamespaceModuleTest, self).setUp()
if env.PYVERSION < (3, 3):
- self.skip("Python before 3.3 doesn't have namespace packages")
+ self.skipTest("Python before 3.3 doesn't have namespace packages")
def test_explicit_namespace_module(self):
self.make_file("namespace/package/module.py", "VAR = 1\n")
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index 16efbcd..5ea2fe1 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -370,7 +370,7 @@ class LoopArcTest(CoverageTest):
def test_other_comprehensions(self):
if env.PYVERSION < (2, 7):
- self.skip("Don't have set or dict comprehensions before 2.7")
+ self.skipTest("Don't have set or dict comprehensions before 2.7")
# Set comprehension:
self.check_coverage("""\
o = ((1,2), (3,4))
@@ -394,7 +394,7 @@ class LoopArcTest(CoverageTest):
def test_multiline_dict_comp(self):
if env.PYVERSION < (2, 7):
- self.skip("Don't have set or dict comprehensions before 2.7")
+ self.skipTest("Don't have set or dict comprehensions before 2.7")
if env.PYVERSION < (3, 5):
arcz = "-42 2B B-4 2-4"
else:
@@ -965,7 +965,7 @@ class YieldTest(CoverageTest):
def test_yield_from(self):
if env.PYVERSION < (3, 3):
- self.skip("Python before 3.3 doesn't have 'yield from'")
+ self.skipTest("Python before 3.3 doesn't have 'yield from'")
self.check_coverage("""\
def gen(inp):
i = 2
@@ -1036,7 +1036,7 @@ class MiscArcTest(CoverageTest):
def test_unpacked_literals(self):
if env.PYVERSION < (3, 5):
- self.skip("Don't have unpacked literals until 3.5")
+ self.skipTest("Don't have unpacked literals until 3.5")
self.check_coverage("""\
d = {
'a': 2,
@@ -1302,7 +1302,7 @@ class AsyncTest(CoverageTest):
def setUp(self):
if env.PYVERSION < (3, 5):
- self.skip("Async features are new in Python 3.5")
+ self.skipTest("Async features are new in Python 3.5")
super(AsyncTest, self).setUp()
def test_async(self):
diff --git a/tests/test_coverage.py b/tests/test_coverage.py
index a98200a..a52aced 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -326,7 +326,7 @@ class SimpleStatementTest(CoverageTest):
def test_print(self):
if env.PY3: # Print statement is gone in Py3k.
- self.skip("No more print statement in Python 3.")
+ self.skipTest("No more print statement in Python 3.")
self.check_coverage("""\
print "hello, world!"
@@ -422,7 +422,7 @@ class SimpleStatementTest(CoverageTest):
# Peephole optimization of jumps to jumps can mean that some statements
# never hit the line tracer. The behavior is different in different
# versions of Python, so don't run this test:
- self.skip("Expected failure: peephole optimization of jumps to jumps")
+ self.skipTest("Expected failure: peephole optimization of jumps to jumps")
self.check_coverage("""\
a = b = c = 0
for n in range(100):
diff --git a/tests/test_files.py b/tests/test_files.py
index e735323..eecdfa7 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -271,7 +271,7 @@ class WindowsFileTest(CoverageTest):
def setUp(self):
if not env.WINDOWS:
- self.skip("Only need to run Windows tests on Windows.")
+ self.skipTest("Only need to run Windows tests on Windows.")
super(WindowsFileTest, self).setUp()
def test_actual_path(self):
diff --git a/tests/test_parser.py b/tests/test_parser.py
index ed18cca..5fee823 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -243,7 +243,7 @@ class ParserMissingArcDescriptionTest(CoverageTest):
def test_missing_arc_descriptions_for_small_callables(self):
# We use 2.7 features here, so just skip this test on 2.6
if env.PYVERSION < (2, 7):
- self.skip("No dict or set comps in 2.6")
+ self.skipTest("No dict or set comps in 2.6")
parser = self.parse_text(u"""\
callables = [
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py
index 0bbf8ea..ccbe01b 100644
--- a/tests/test_phystokens.py
+++ b/tests/test_phystokens.py
@@ -123,7 +123,7 @@ class SourceEncodingTest(CoverageTest):
if env.PYPY and env.PY3:
# PyPy3 gets this case wrong. Not sure what I can do about it,
# so skip the test.
- self.skip("PyPy3 is wrong about non-comment encoding. Skip it.")
+ self.skipTest("PyPy3 is wrong about non-comment encoding. Skip it.")
# Should not detect anything here
source = b'def parse(src, encoding=None):\n pass'
self.assertEqual(source_encoding(source), DEF_ENCODING)
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index fe43c4c..8ea0a8f 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -248,7 +248,7 @@ class PluginWarningOnPyTracer(CoverageTest):
"""Test that we get a controlled exception with plugins on PyTracer."""
def test_exception_if_plugins_on_pytracer(self):
if env.C_TRACER:
- self.skip("This test is only about PyTracer.")
+ self.skipTest("This test is only about PyTracer.")
self.make_file("simple.py", """a = 1""")
@@ -268,7 +268,7 @@ class FileTracerTest(CoverageTest):
def setUp(self):
super(FileTracerTest, self).setUp()
if not env.C_TRACER:
- self.skip("Plugins are only supported with the C tracer.")
+ self.skipTest("Plugins are only supported with the C tracer.")
class GoodPluginTest(FileTracerTest):
diff --git a/tests/test_process.py b/tests/test_process.py
index e40c4dc..51bdaf2 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -521,7 +521,7 @@ class ProcessTest(CoverageTest):
if sys.version_info < (2, 7):
# Coverage.py isn't bug-for-bug compatible in the behavior of -m for
# Pythons < 2.7
- self.skip("-m doesn't work the same < Python 2.7")
+ self.skipTest("-m doesn't work the same < Python 2.7")
# https://bitbucket.org/ned/coveragepy/issue/207
self.make_file("package/__init__.py", "print('init')")
self.make_file("package/__main__.py", "print('main')")
@@ -531,7 +531,7 @@ class ProcessTest(CoverageTest):
def test_fork(self):
if not hasattr(os, 'fork'):
- self.skip("Can't test os.fork since it doesn't exist.")
+ self.skipTest("Can't test os.fork since it doesn't exist.")
self.make_file("fork.py", """\
import os
@@ -670,10 +670,10 @@ class ProcessTest(CoverageTest):
def test_fullcoverage(self): # pragma: not covered
if env.PY2: # This doesn't work on Python 2.
- self.skip("fullcoverage doesn't work on Python 2.")
+ self.skipTest("fullcoverage doesn't work on Python 2.")
# It only works with the C tracer, and if we aren't measuring ourselves.
if not env.C_TRACER or env.METACOV:
- self.skip("fullcoverage only works with the C tracer.")
+ self.skipTest("fullcoverage only works with the C tracer.")
# fullcoverage is a trick to get stdlib modules measured from
# the very beginning of the process. Here we import os and
@@ -737,7 +737,7 @@ class ProcessTest(CoverageTest):
if sys.version_info < (2, 7):
# Python 2.6 thinks that coverage is a package that can't be
# executed
- self.skip("-m doesn't work the same < Python 2.7")
+ self.skipTest("-m doesn't work the same < Python 2.7")
# https://bitbucket.org/ned/coveragepy/issues/478/help-shows-silly-program-name-when-running
out = self.run_command("python -m coverage")
self.assertIn("Use 'coverage help' for help", out)
@@ -1023,7 +1023,7 @@ class ProcessStartupTest(ProcessCoverageMixin, CoverageTest):
def test_subprocess_with_pth_files(self): # pragma: not covered
if env.METACOV:
- self.skip("Can't test sub-process pth file suppport during metacoverage")
+ self.skipTest("Can't test sub-process pth file suppport during metacoverage")
# Main will run sub.py
self.make_file("main.py", """\
@@ -1085,7 +1085,7 @@ class ProcessStartupWithSourceTest(ProcessCoverageMixin, CoverageTest):
"""
if env.METACOV:
- self.skip("Can't test sub-process pth file suppport during metacoverage")
+ self.skipTest("Can't test sub-process pth file suppport during metacoverage")
def fullname(modname):
"""What is the full module name for `modname` for this test?"""
diff --git a/tests/test_summary.py b/tests/test_summary.py
index 97171b5..de92f45 100644
--- a/tests/test_summary.py
+++ b/tests/test_summary.py
@@ -509,7 +509,7 @@ class SummaryTest(CoverageTest):
def test_pyw_files(self):
if not env.WINDOWS:
- self.skip(".pyw files are only on Windows.")
+ self.skipTest(".pyw files are only on Windows.")
# https://bitbucket.org/ned/coveragepy/issue/261
self.make_file("start.pyw", """\
@@ -550,7 +550,7 @@ class SummaryTest(CoverageTest):
def test_missing_py_file_during_run(self):
# PyPy2 doesn't run bare .pyc files.
if env.PYPY and env.PY2:
- self.skip("PyPy2 doesn't run bare .pyc files")
+ self.skipTest("PyPy2 doesn't run bare .pyc files")
# Create two Python files.
self.make_file("mod.py", "a = 1\n")