0

Since today morning I'm having some weird problem with Python's unit-testing tool Nose + NoseGAE. I want to run unit-tests for my GAE project in terminal and it ends with this error:

Traceback (most recent call last):
  File "/usr/local/bin/nosetests", line 8, in <module>
    load_entry_point('nose==1.2.1', 'console_scripts', 'nosetests')()
  File "/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg/nose/core.py", line 118, in __init__
    **extra_args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg/nose/core.py", line 135, in parseArgs
    self.config.configure(argv, doc=self.usage())
  File "/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg/nose/config.py", line 338, in configure
    self.plugins.configure(options, self)
  File "/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg/nose/plugins/manager.py", line 284, in configure
    cfg(options, config)
  File "/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "build/bdist.macosx-10.7-intel/egg/nosegae.py", line 84, in configure
  File "/usr/local/google_appengine/google/appengine/tools/dev_appserver.py", line 61, in <module>
    import simplejson
ImportError: No module named simplejson

It's weird because I'm not even using simplejson anywhere. I know it's part of Django, but I'm not using it either.

OS X 10.7.4
Python 2.7.1
Nose 1.2.1
NoseGAE 0.2.0

Do you have any idea what might be wrong?

martin
  • 93,354
  • 25
  • 191
  • 226
  • simplejson is used in dev_appserver.py (exactly what the error says). It just looks like your tests (or nosegae) isn't picking up /usr/local/google_appengine/lib directory (that's where simplejson lib is). That is, your PYTHONPATH or sys.path should contain /usr/local/google_appengine/lib. What's the command line args you're running your tests with? – alex Sep 17 '12 at 11:53
  • I run it only with `--with-gae` – martin Sep 17 '12 at 12:37
  • Ok, I solved it like here http://stackoverflow.com/questions/5210584/tipfy-nosetest-importerror-no-module-named-fancy-urllib Setting PYTHONPATH didn't help, and `--gae-lib-root` either. It just threw a different error. – martin Sep 17 '12 at 14:42
  • Yeah, I was doing that too for a while, 'till I was tired changing it after each new release. Then I removed /usr/local/bin/dev_appserver.py and put /usr/local/google_appengine dir in my PATH (not to be mistaken with PYTHONPATH), and all these weird errors disappeared. – alex Sep 17 '12 at 15:44

1 Answers1

0

This was probably just temporary problem in older GAE on OS X. Newer versions run without any problem.

martin
  • 93,354
  • 25
  • 191
  • 226