| 1 | # -*- coding: utf-8 -*- |
|---|
| 2 | """ |
|---|
| 3 | Doctest runner for 'rcom.recipe.seleniumenv'. |
|---|
| 4 | """ |
|---|
| 5 | __docformat__ = 'restructuredtext' |
|---|
| 6 | |
|---|
| 7 | import unittest |
|---|
| 8 | import zc.buildout.tests |
|---|
| 9 | import zc.buildout.testing |
|---|
| 10 | |
|---|
| 11 | from zope.testing import doctest, renormalizing |
|---|
| 12 | |
|---|
| 13 | optionflags = (doctest.ELLIPSIS | |
|---|
| 14 | doctest.NORMALIZE_WHITESPACE | |
|---|
| 15 | doctest.REPORT_ONLY_FIRST_FAILURE) |
|---|
| 16 | |
|---|
| 17 | def setUp(test): |
|---|
| 18 | zc.buildout.testing.buildoutSetUp(test) |
|---|
| 19 | |
|---|
| 20 | # Install the recipe in develop mode |
|---|
| 21 | zc.buildout.testing.install_develop('rcom.recipe.seleniumenv', test) |
|---|
| 22 | |
|---|
| 23 | # Install any other recipes that should be available in the tests |
|---|
| 24 | #zc.buildout.testing.install('collective.recipe.foobar', test) |
|---|
| 25 | |
|---|
| 26 | def test_suite(): |
|---|
| 27 | suite = unittest.TestSuite(( |
|---|
| 28 | doctest.DocFileSuite( |
|---|
| 29 | '../README.txt', |
|---|
| 30 | setUp=setUp, |
|---|
| 31 | tearDown=zc.buildout.testing.buildoutTearDown, |
|---|
| 32 | optionflags=optionflags, |
|---|
| 33 | checker=renormalizing.RENormalizing([ |
|---|
| 34 | # If want to clean up the doctest output you |
|---|
| 35 | # can register additional regexp normalizers |
|---|
| 36 | # here. The format is a two-tuple with the RE |
|---|
| 37 | # as the first item and the replacement as the |
|---|
| 38 | # second item, e.g. |
|---|
| 39 | # (re.compile('my-[rR]eg[eE]ps'), 'my-regexps') |
|---|
| 40 | zc.buildout.testing.normalize_path, |
|---|
| 41 | ]), |
|---|
| 42 | ), |
|---|
| 43 | )) |
|---|
| 44 | return suite |
|---|
| 45 | |
|---|
| 46 | if __name__ == '__main__': |
|---|
| 47 | unittest.main(defaultTest='test_suite') |
|---|