I have a patch I developed, and I would like to run the trac unit
tests to make sure I haven't broken anything. But when I try to run
the unit tests following the instructions on the wiki at wiki/TracDev/
UnitTests, I can't. I get an import error that I haven't been able to
make go away.
I don't know if it is a trac problem, or a python problem, or if I
have borked my version of python or trac, or if I am just borked in
the head. Cause I am still a trac and python newbie.
Here is the error. It is with Trac 0.11.1, running on Centos 5, and
on Python 2.4.3.
[r...@kermit trac-0.11.1]# PYTHONPATH=. trac/test.py
Traceback (most recent call last):
File "trac/test.py", line 270, in ?
unittest.main(defaultTest='suite')
File "/usr/lib/python2.4/unittest.py", line 758, in __init__
self.parseArgs(argv)
File "/usr/lib/python2.4/unittest.py", line 785, in parseArgs
self.createTests()
File "/usr/lib/python2.4/unittest.py", line 791, in createTests
self.module)
File "/usr/lib/python2.4/unittest.py", line 556, in
loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/lib/python2.4/unittest.py", line 544, in
loadTestsFromName
test = obj()
File "trac/test.py", line 236, in suite
import trac.tests
ImportError: No module named tests
[r...@kermit trac-0.11.1]#
The symptoms seem to be that PYTHONPATH is being ignored. I get the
same error message if I explicitly:
$ export PYTHONPATH=.
$ trac/test.py
It also seems to be ignored because when I run strace on this:
PYTHONPATH=. strace python trac/test.py
I get the same message, but more importantly, I see no evidence that
anyfiles in my trac subdirectory apart from test.py is being opened.
All opens/fstats/... take place in /usr/lib/python and system
directories.
The same holds true if I don't use . but use /opt/trac/trac-0.11.1
where I have my trac setup located.
Pointing it to being a python issue, or a local python screwup on my
part is that if I replicate the directory structure and the generic
structure of the files in trac/tests and do the import on python 2.4.4
on Windows, the imports work just fine.
Does anyone have any hints as to what might be wrong, or what I have
done wrong, or how to diagnose this further? Or even, what other
forums or websites or irc channels might be good ones to ask this
question on?
Apart from that, trac in mod_python and tracd seem to be running just
fine.
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---