Skip to content

Instantly share code, notes, and snippets.

@gahcep
Created February 10, 2013 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gahcep/4749703 to your computer and use it in GitHub Desktop.
Save gahcep/4749703 to your computer and use it in GitHub Desktop.
Article 'QA in Python - working with unittest'
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