[py-dev] Odd import issue with tests for compatibility modules.

David Stanek dstanek at dstanek.com
Wed Jun 15 19:36:45 CEST 2005


The support for Python compatibility modules has been merged into trunk. I
pulled the modules (doctest, optparse and testwrap) along with their tests
from Python-r241. I was able to modify almost all of the tests to make
sure they are testing the compat module and not the library module

However, I am having an issue with py/compat/testing/doctest2.py. The
original  has a testing function that imports itself and then passtest
that to a test.test_support.run_doctest method. To mimic that I tried
passing the run_doctests method the following:
 * sys.modules['__main__']
 * test_doctest2 after a from py.__.compat.testing import test_doctest2

These do not work...well, all test are successful, but 2 are not being
run. And they just happen to be the two that contain unicode characters.
If I remove the characters the test will execute successfully. The test is
not failing it is just not being run.

To debug I added a line to print out the __doc__ of the module, which is
one of the tests that is not being executed. The string did NOT include
the doctest code. So this seems to be an import thing and not something to
do with unicode and/or doctest.

Any ideas? I have to take a break from this so that I can get a fresh
perspective.

David




More information about the Pytest-dev mailing list