-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Test unittest integration.""" | ||
# pylint: disable=missing-docstring,no-self-use | ||
import sys | ||
import unittest | ||
|
||
from flexmock import flexmock | ||
|
||
|
||
class TestUnitTestIntegration(unittest.TestCase): | ||
"""Flexmock unittest integration specific tests.""" | ||
|
||
def test_failed_test_case(self): | ||
"""This tests that after a successful tests, failing flexmock assertions | ||
will change the test result from successful to failed. | ||
""" | ||
flexmock().should_receive("this_test_should_fail").once() | ||
|
||
|
||
if __name__ == "__main__": | ||
EXPECTED_FAILURES = 1 | ||
EXPECTED_TESTS = 1 | ||
test = unittest.main(exit=False) | ||
|
||
if len(test.result.failures) == EXPECTED_FAILURES and test.result.testsRun == EXPECTED_TESTS: | ||
sys.exit(0) # OK | ||
sys.exit(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