fritzo / pomagma

An inference engine for extensional untyped λ-calculus
Other
17 stars 2 forks source link

Protobuf error on OS X: KeyError ('DESCRIPTOR') #48

Closed fritzo closed 7 years ago

fritzo commented 8 years ago

On OS X

$ uname -a
Darwin fritz-air 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64

$ make test
...
pomagma.workers_test.test_structure_queue ... ok

======================================================================
ERROR: Failure: KeyError ('DESCRIPTOR')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/fritz/.virtualenvs/pomagma/lib/python2.7/site-packages/nose/loader.py", line 523, in makeTest
    return self._makeTest(obj, parent)
  File "/Users/fritz/.virtualenvs/pomagma/lib/python2.7/site-packages/nose/loader.py", line 568, in _makeTest
    obj = transplant_class(obj, parent.__name__)
  File "/Users/fritz/.virtualenvs/pomagma/lib/python2.7/site-packages/nose/util.py", line 642, in transplant_class
    class C(cls):
  File "/Users/fritz/.virtualenvs/pomagma/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 131, in __new__
    descriptor = dictionary[GeneratedProtocolMessageType._DESCRIPTOR_KEY]
KeyError: 'DESCRIPTOR'

----------------------------------------------------------------------
Ran 337 tests in 218.073s

FAILED (SKIP=8, errors=1)
caimaoy commented 8 years ago

Yes, I have the same problem

drielsma commented 7 years ago

I've been banging my head against this for a while and finally realized that this error arises when nose is trying to discover whether there are any tests in compiled python files that were generated by protoc (test models that I load in my unit tests). Excluding them via -e does the trick, ie nosetests -e _pb2.py

fritzo commented 7 years ago

Thanks, @drielsma ! I've switched from nose to pytest, so hopefully this error will no longer arise.