Mercurial > p > roundup > code
view test/test_textfmt.py @ 5035:b5bb492e4b3c
Rename TestMessage to ExampleMessage
When py.test is searching for tests it detects TestMessage as a
potential class with test cases because it has 'Test' in its name.
Because TestMessage contains a __init__ constructor py.test returns a
warning that it can't collect tests from it. Lets rename the class to
ExampleMessage to avoid this issue.
| author | John Kristensen <john@jerrykan.com> |
|---|---|
| date | Fri, 21 Aug 2015 17:37:22 +1000 |
| parents | f35ece8f8ff7 |
| children | 364c54991861 |
line wrap: on
line source
import unittest from roundup.support import wrap class WrapTestCase(unittest.TestCase): def testWrap(self): lorem = '''Lorem ipsum dolor sit amet, consectetuer adipiscing elit.''' wrapped = '''Lorem ipsum dolor sit amet, consectetuer adipiscing elit.''' self.assertEquals(wrap(lorem, 20), wrapped) def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(WrapTestCase)) return suite
