#105 closed defect (fixed)
'module' object has no attribute 'suite'
| Reported by: | anonymous | Owned by: | jhampton |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.6 |
| Component: | Trac plugin | Version: | 0.5.2 |
| Keywords: | Cc: | ||
| Operating System: | Windows |
Description (last modified by cmlenz)
$ python setup.py test
running test
running egg_info
writing ./Bitten.egg-info/PKG-INFO
writing top-level names to ./Bitten.egg-info/top_level.txt
writing entry points to ./Bitten.egg-info/entry_points.txt
running build_ext
Traceback (most recent call last):
File "setup.py", line 60, in ?
test_suite='bitten.tests.suite', zip_safe=True
File "/usr/lib/python2.3/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/lib/python2.3/distutils/dist.py", line 907, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command
cmd_obj.run()
File "/usr/lib/python2.3/site-packages/setuptools-0.6a8-py2.3.egg/setuptools/command/test.py", line 56, in run
self.run_tests()
File "/usr/lib/python2.3/site-packages/setuptools-0.6a8-py2.3.egg/setuptools/command/test.py", line 69, in run_tests
unittest.main(None, None, [unittest.__file__]+self.test_args)
File "/usr/lib/python2.3/unittest.py", line 720, in __init__
self.parseArgs(argv)
File "/usr/lib/python2.3/unittest.py", line 747, in parseArgs
self.createTests()
File "/usr/lib/python2.3/unittest.py", line 753, in createTests
self.module)
File "/usr/lib/python2.3/unittest.py", line 519, in loadTestsFromNames
suites.append(self.loadTestsFromName(name, module))
File "/usr/lib/python2.3/unittest.py", line 493, in loadTestsFromName
obj = getattr(obj, part)
AttributeError: 'module' object has no attribute 'suite'
Attachments (2)
Change History (13)
comment:1 Changed 20 years ago by cmlenz
- Description modified (diff)
comment:2 Changed 20 years ago by cmlenz
- Resolution set to worksforme
- Status changed from new to closed
Closing due to lack of feedback.
comment:3 Changed 20 years ago by silver.aabjoe@…
- Operating System changed from Linux to Windows
- Priority changed from minor to critical
- Resolution worksforme deleted
- Status changed from closed to reopened
python setup.py test
running test
running egg_info
writing Bitten.egg-info\PKG-INFO
writing top-level names to Bitten.egg-info\top_level.txt
writing entry points to Bitten.egg-info\entry_points.txt
reading manifest file 'Bitten.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Bitten.egg-info\SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "setup.py", line 60, in ?
test_suite='bitten.tests.suite', zip_safe=True
File "C:\Program Files\Python\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\Program Files\Python\lib\distutils\dist.py", line 907, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python\lib\distutils\dist.py", line 927, in run_command
cmd_obj.run()
File "c:\program files\python\lib\site-packages\setuptools-0.6a11-py2.3.egg\setuptools\command\test.py", line 100, in run
self.run_tests()
File "c:\program files\python\lib\site-packages\setuptools-0.6a11-py2.3.egg\setuptools\command\test.py", line 118, in run_tests
testLoader = loader_class()
File "C:\Program Files\Python\lib\unittest.py", line 720, in __init__
self.parseArgs(argv)
File "C:\Program Files\Python\lib\unittest.py", line 747, in parseArgs
self.createTests()
File "C:\Program Files\Python\lib\unittest.py", line 753, in createTests
self.module)
File "C:\Program Files\Python\lib\unittest.py", line 519, in loadTestsFromNames
suites.append(self.loadTestsFromName(name, module))
File "C:\Program Files\Python\lib\unittest.py", line 493, in loadTestsFromName
obj = getattr(obj, part)
AttributeError: 'module' object has no attribute 'suite'
python version is 2.3.5
with python 2.4.3 i get
running test
running egg_info
writing Bitten.egg-info\PKG-INFO
writing top-level names to Bitten.egg-info\top_level.txt
writing entry points to Bitten.egg-info\entry_points.txt
reading manifest file 'Bitten.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Bitten.egg-info\SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "setup.py", line 60, in ?
test_suite='bitten.tests.suite', zip_safe=True
File "C:\Program Files\Python\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\Program Files\Python\lib\distutils\dist.py", line 946, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python\lib\distutils\dist.py", line 966, in run_command
cmd_obj.run()
File "c:\program files\python\lib\site-packages\setuptools-0.6a11-py2.4.egg\setuptools\command\test.py", line 100, in run
self.run_tests()
File "c:\program files\python\lib\site-packages\setuptools-0.6a11-py2.4.egg\setuptools\command\test.py", line 118, in run_tests
testLoader = loader_class()
File "C:\Program Files\Python\lib\unittest.py", line 758, in __init__
self.parseArgs(argv)
File "C:\Program Files\Python\lib\unittest.py", line 785, in parseArgs
self.createTests()
File "C:\Program Files\Python\lib\unittest.py", line 791, in createTests
self.module)
File "C:\Program Files\Python\lib\unittest.py", line 556, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "C:\Program Files\Python\lib\unittest.py", line 532, in loadTestsFromName
parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'tests'
Trac is not installed. I tried
set PYTHONPATH=.;python;d:\bitten\tests\__init__.py set PYTHONPATH=.;c:\program files\python\;d:\bitten\tests\__init__.py set PYTHONPATH=.;python;bitten\tests\__init__.py
but no luck
comment:4 Changed 20 years ago by cmlenz
Trac is required to be installed.
If you run:
$ PYTHONPATH=. python bitten/tests/__init__.py
as I noted above, you should see an error about some trac.xxx import failing.
The error message of the setuptools test command is unfortunately rather useless, but there's nothing I can do about that AFAIK.
comment:5 Changed 20 years ago by silver.aabjoe@…
Am I required to install trac to use bitten-slave?
comment:6 Changed 20 years ago by cmlenz
No, only for the master. The tests, however, test both slave and master functionality, so you currently do need Trac to run them.
comment:7 Changed 17 years ago by wbell
- Resolution set to worksforme
- Status changed from reopened to closed
Tests pass on both windows and linux. Closing.
comment:8 Changed 16 years ago by jhampton
- Cc jhampton added
- Milestone set to 0.6
- Priority changed from critical to minor
- Resolution worksforme deleted
- Status changed from closed to reopened
I ran into this today. The issue is indeed the fact that I didn't have Trac installed on the machine I was trying to use for the tests.
Throwing the horrible unittest exception is VERY misleading. If Trac isn't installed, we should simply skip the master related tests. The slave tests still execute fine.
Attached is a patch to skip the master related tests if Trac is not installed
comment:9 Changed 16 years ago by jhampton
So, stupid me didn't test his fix for the tests before posting the patch. Attached is the "fixed" patch. Meant to replace the existing patch, but forgot to click the check box.
comment:10 Changed 16 years ago by osimons
- Cc jhampton removed
- Owner changed from cmlenz to jhampton
- Status changed from reopened to new
Thanks for the patch! Committed in [696] slightly reorganized.
comment:11 Changed 16 years ago by osimons
- Resolution set to fixed
- Status changed from new to closed
...and closing.

Can you please try running:
?
I suspect this error is due to Trac not being installed (or otherwise on the Python path).