simoorg icon indicating copy to clipboard operation
simoorg copied to clipboard

Can't run tests from source using python 2.7

Open srikanth-viswanathan opened this issue 9 years ago • 8 comments

Can't run tests from source. I do:

git clone https://github.com/linkedin/simoorg.git
cd simoorg
python setup.py test

This is what I see on Ubuntu 14.04 running python 2.7:

vagrant@vagrant-ubuntu-trusty-64:~/simoorg$ python setup.py test
running test
running egg_info
writing requirements to src/simoorg.egg-info/requires.txt
writing src/simoorg.egg-info/PKG-INFO
writing top-level names to src/simoorg.egg-info/top_level.txt
writing dependency_links to src/simoorg.egg-info/dependency_links.txt
writing entry points to src/simoorg.egg-info/entry_points.txt
reading manifest file 'src/simoorg.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'product-spec.json'
warning: no files found matching 'mppy-pinned.txt'
writing manifest file 'src/simoorg.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 59, in <module>
    'simoorg = simoorg.__main__:main'
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", line 142, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", line 122, in with_project_on_sys_path
    func()
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", line 163, in run_tests
    testRunner=self._resolve_as_ep(self.test_runner),
  File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python2.7/unittest/loader.py", line 103, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", line 37, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
    module = __import__('.'.join(parts_copy))
  File "/usr/lib/python2.7/test/regrtest.py", line 183, in <module>
    for module in sys.modules.itervalues():
RuntimeError: dictionary changed size during iteration

(Also see something similar on Mac OS X 10.10.5)

srikanth-viswanathan avatar Sep 29 '15 21:09 srikanth-viswanathan

Hey Srikanth, Try using nosetests to test the package, you will need to run the command python2.7 setup.py nosetests (Though looks like there are some tests that needs to be fixed , I will start working on getting those fixed and update the document to reflect the use of nosetests instead of test )

sarathsreedharan avatar Oct 06 '15 23:10 sarathsreedharan

@sarathsreedharan Thanks. nosetests does actually run the tests. Not all tests pass, however. Should we keep this issue open to track that? The original reason I entered this ticket was so I could verify all tests passed before attempting to contribute a patch elsewhere in the simoorg code.

srikanth-viswanathan avatar Oct 07 '15 01:10 srikanth-viswanathan

Yes, let's keep the issue open till we fix all the tests

sarathsreedharan avatar Oct 11 '15 23:10 sarathsreedharan

have created https://github.com/linkedin/simoorg/pull/9 for this issue

sarathsreedharan avatar Oct 16 '15 21:10 sarathsreedharan

Hi Sarath,

I am going to merge this pull request, if that's ok.

Thanks,

Mayuresh

On Fri, Oct 16, 2015 at 2:31 PM, sarathsreedharan [email protected] wrote:

have created #9 https://github.com/linkedin/simoorg/pull/9 for this issue

— Reply to this email directly or view it on GitHub https://github.com/linkedin/simoorg/issues/6#issuecomment-148841398.

-Regards, Mayuresh R. Gharat (862) 250-7125

MayureshGharat avatar Oct 27 '15 17:10 MayureshGharat

Sounds good

sarathsreedharan avatar Oct 27 '15 17:10 sarathsreedharan

i am running 👍 python setup.py test then i got this: File "/usr/lib/python2.7/test/regrtest.py", line 183, in for module in sys.modules.itervalues(): RuntimeError: dictionary changed size during iteration

anhvngo avatar Apr 23 '16 23:04 anhvngo

Hey Anh, Like I mentioned previously could you try to use 'python2.7 setup.py nosetests', instead of just 'python setup.py test' that should help you run the actual unittests, meanwhile I will open a ticket to get the change reflected in the documents also.

sarathsreedharan avatar Apr 23 '16 23:04 sarathsreedharan