Something went wrongs with tests

Issue #117 resolved
aelmahmoudy
created an issue

Running tests in Whoosh 1.7.6 (using python 2.6) fails:

$ python setup.py test running test running egg_info writing src/Whoosh.egg-info/PKG-INFO writing top-level names to src/Whoosh.egg-info/top_level.txt writing dependency_links to src/Whoosh.egg-info/dependency_links.txt reading manifest file 'src/Whoosh.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '.txt' under directory 'tests' warning: no files found matching '.txt' under directory 'files' warning: no files found matching '.py' under directory 'files' warning: no files found matching '.jpg' under directory 'files' writing manifest file 'src/Whoosh.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File "setup.py", line 36, in <module> "Topic :: Text Processing :: Indexing", File "/usr/lib/python2.6/distutils/core.py", line 152, in setup dist.run_commands() File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands self.run_command(cmd) File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command cmd_obj.run() File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", line 137, in run self.with_project_on_sys_path(self.run_tests) File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", line 117, in with_project_on_sys_path func() File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", line 146, in run_tests testLoader = loader_class() File "/usr/lib/python2.6/unittest.py", line 816, in init self.parseArgs(argv) File "/usr/lib/python2.6/unittest.py", line 843, in parseArgs self.createTests() File "/usr/lib/python2.6/unittest.py", line 849, in createTests self.module) File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python2.6/unittest.py", line 576, in loadTestsFromName module = import('.'.join(parts_copy)) ImportError: No module named tests

So I found that Whoosh 1.7.6 lacks init.py file, so I added it manually, then another failure happens:

running test running egg_info writing src/Whoosh.egg-info/PKG-INFO writing top-level names to src/Whoosh.egg-info/top_level.txt writing dependency_links to src/Whoosh.egg-info/dependency_links.txt reading manifest file 'src/Whoosh.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '.txt' under directory 'tests' warning: no files found matching '.txt' under directory 'files' warning: no files found matching '.py' under directory 'files' warning: no files found matching '.jpg' under directory 'files' writing manifest file 'src/Whoosh.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File "setup.py", line 36, in <module> "Topic :: Text Processing :: Indexing", File "/usr/lib/python2.6/distutils/core.py", line 152, in setup dist.run_commands() File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands self.run_command(cmd) File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command cmd_obj.run() File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", line 137, in run self.with_project_on_sys_path(self.run_tests) File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", line 117, in with_project_on_sys_path func() File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", line 146, in run_tests testLoader = loader_class() File "/usr/lib/python2.6/unittest.py", line 816, in init self.parseArgs(argv) File "/usr/lib/python2.6/unittest.py", line 843, in parseArgs self.createTests() File "/usr/lib/python2.6/unittest.py", line 849, in createTests self.module) File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/usr/lib/python2.6/unittest.py", line 587, in loadTestsFromName return self.loadTestsFromModule(obj) File "/usr/lib/python2.6/dist-packages/setuptools/command/test.py", line 34, in loadTestsFromModule tests.append(self.loadTestsFromName(submodule)) File "/usr/lib/python2.6/unittest.py", line 584, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'test_searching'

I don't know how to fix that.

Comments (3)

  1. Matt Chaput repo owner
    • changed status to open

    I switched the tests to Nose style. Hopefully this won't be a big problem. You will need to have Node installed, and then you can do

    python setup.py nosetests
    

    or just

    nosetests
    

    What I didn't realize before just now is that I can still allow

    python setup.py tests
    

    ...using the setting detailed here:

    http://somethingaboutorange.com/mrl/projects/nose/0.11.1/setuptools_integration.html

    setup (
        # ...
        test_suite = 'nose.collector'
    )
    

    I will add that line to Whoosh's setup.py ASAP.

  2. Log in to comment