Created
February 10, 2013 14:14
-
-
Save gahcep/4749703 to your computer and use it in GitHub Desktop.
Article 'QA in Python - working with unittest'
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
import unittest | |
class BaseTestClass(object): | |
def test_base_1(self): | |
self.assertEquals(210, 110 * 2 - 10) | |
def test_base_2(self): | |
self.assertTrue(False is not None) | |
class DerivedTestClassA(unittest.TestCase, BaseTestClass): | |
def test_derived_a(self): | |
self.assertEquals(100, 10 * 10) | |
class DerivedTestClassB(unittest.TestCase, BaseTestClass): | |
def test_derived_b(self): | |
self.assertEquals(45, 46 - 1) | |
if __name__ == '__main__': | |
unittest.main() | |
# CLI run options | |
# - pyexample_6_multiple_inher.py -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment