forked from nose-devs/nose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement support for unittest.expectedFailure
Fixes issue nose-devs#33
- Loading branch information
Showing
7 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import unittest | ||
|
||
class TC(unittest.TestCase): | ||
@unittest.expectedFailure | ||
def test(self): | ||
assert False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import unittest | ||
|
||
class TC(unittest.TestCase): | ||
@unittest.expectedFailure | ||
def test(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import unittest | ||
from nose.plugins.plugintest import PluginTester, remove_timings | ||
|
||
support = os.path.join(os.path.dirname(__file__), 'support') | ||
|
||
|
||
class TestExpectedFailure(PluginTester, unittest.TestCase): | ||
activate = '-v' | ||
plugins = [] | ||
suitepath = os.path.join(support, 'expected_failure') | ||
|
||
def test_expected_failure(self): | ||
print self.output | ||
output = remove_timings(str(self.output)) | ||
assert output == """\ | ||
test (test.TC) ... expected failure | ||
---------------------------------------------------------------------- | ||
Ran 1 test in ...s | ||
OK (expectedFailures=1) | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import unittest | ||
from nose.plugins.plugintest import PluginTester, remove_timings | ||
|
||
support = os.path.join(os.path.dirname(__file__), 'support') | ||
|
||
|
||
class TestExpectedFailure(PluginTester, unittest.TestCase): | ||
activate = '-v' | ||
plugins = [] | ||
suitepath = os.path.join(support, 'unexpected_success') | ||
|
||
def test_expected_failure(self): | ||
print self.output | ||
output = remove_timings(str(self.output)) | ||
assert output == """\ | ||
test (test.TC) ... unexpected success | ||
---------------------------------------------------------------------- | ||
Ran 1 test in ...s | ||
FAILED (unexpectedSuccesses=1) | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters