strange unittest issue

Chris Fonnesbeck fonnesbeck at gmail.com
Wed Sep 20 17:25:34 EDT 2006


I have a Python module that I have set up with some unit testing code, which
is simply a class that subclasses unittest.TestCase. Strangely, however, I
am having some issues trying to call the code. Specifically, if I do the
following:

>>> from PyMC import MCMC
>>> MCMC.unittest.main()

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

However, the following works:

>>> from PyMC.MCMC import *
>>> unittest.main()

The unit test runs as expected. This seems odd, since the former should be
the preferred syntax, as we are told the "from foo import *" syntax is to be
avoided.

Any idea why this is not working as expected?

C.

-- 
Chris Fonnesbeck + Atlanta, GA + http://trichech.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060920/5593eaad/attachment.html>


More information about the Python-list mailing list