Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

workaround for SkipTest error

  • Loading branch information...
commit e6eda34f7c3d2dcfbfa2c0216d134c02bc7b1120 1 parent 095e413
@kumar303 authored
View
5 nosenicedots/plugin.py
@@ -108,10 +108,11 @@ def addFailure(self, test, err):
self.stream.flush()
def addSkip(self, test, reason):
- # only in 2.7+
self.stream.writeln("")
self.stream.writeln("SKIP: %s" % nice_test_address(test))
- super(TestResult, self).addSkip(test, reason)
+ base = super(TestResult, self)
+ if hasattr(base, 'addSkip'):
+ base.addSkip(test, reason)
def addSuccess(self, test):
TestResult.addSuccess(self, test)
View
9 nosenicedots/tests/example-suite/test_stuff/test_classes.py
@@ -1,6 +1,8 @@
-
import unittest
+from nose.exc import SkipTest
+
+
class TestClass(unittest.TestCase):
def test_one(self):
@@ -13,4 +15,7 @@ def test_failing(self):
assert 0
def test_error(self):
- raise RuntimeError
+ raise RuntimeError
+
+ def test_skip(self):
+ raise SkipTest('skipped')
View
1  nosenicedots/tests/test_functional.py
@@ -64,6 +64,7 @@ def test_suite(self):
# Handle ContextSuite
assert ('ERROR: nosenicedots/tests/example-suite/test_stuff/'
'test_failing_context.py:setup') in self.output
+ assert "has no attribute 'addSkip'" not in self.output
class TestStop(NiceDotsTest, unittest.TestCase):
View
3  nosenicedots/tests/test_units.py
@@ -111,7 +111,8 @@ def test_missing_working_dir(self):
os.chdir(tmp)
shutil.rmtree(tmp)
p = nice_path(__file__)
- assert p.startswith(__file__), ('Unexpected: %s' % p)
+ assert p.startswith(__file__), (
+ '%s does not start with %s' % (p, __file__))
finally:
os.chdir(pwd)
Please sign in to comment.
Something went wrong with that request. Please try again.