Mercurial > p > roundup > code
diff test/test_mailgw.py @ 5033:63c79c0992ae
Update tests to work with py.test
py.test searches for any class that looks like a TestCase in the test
directory and tries to run them as tests. Some of the classes that
inherit TestCase are not meant to be run and are only intended to be
"helper classes". Only the tests of the classes that inherit the "helper
classes" should be run. If we convert these "helper classes" to be
"mixins" py.test should not pick them up.
| author | John Kristensen <john@jerrykan.com> |
|---|---|
| date | Thu, 20 Aug 2015 14:44:49 +1000 |
| parents | 868db43b302a |
| children | 380d8d8b30a3 |
line wrap: on
line diff
--- a/test/test_mailgw.py Tue Jan 12 04:33:53 2016 +0300 +++ b/test/test_mailgw.py Thu Aug 20 14:44:49 2015 +1000 @@ -141,7 +141,8 @@ from roundup.hyperdb import String -class MailgwTestAbstractBase(unittest.TestCase, DiffHelper): + +class MailgwTestAbstractBase(DiffHelper): count = 0 schema = 'classic' def setUp(self): @@ -233,7 +234,7 @@ self.assertEqual(self.db.issue.get(nodeid, 'tx_Source'), 'email') -class MailgwTestCase(MailgwTestAbstractBase): +class MailgwTestCase(MailgwTestAbstractBase, unittest.TestCase): def testMessageWithFromInIt(self): nodeid = self._handle_mail('''Content-Type: text/plain; @@ -3261,7 +3262,8 @@ fileid = self.db.msg.get(msgid, 'files')[0] self.assertEqual(self.db.file.get(fileid, 'type'), 'message/rfc822') -class MailgwPGPTestCase(MailgwTestAbstractBase): + +class MailgwPGPTestCase(MailgwTestAbstractBase, unittest.TestCase): pgphome = gpgmelib.pgphome def setUp(self): MailgwTestAbstractBase.setUp(self)
