Google App Engine은 Python의 logging
모듈을 완벽하게 지원합니다. 그러나 nosetests --with-gae
을 사용하여 코드를 테스트 할 때 오류가 발생합니다. 내 응용 프로그램 스크립트의에 import logging
문이없는 경우 nose-gae가 mkstemp 및 스레딩에 대한 오류를 발생시킵니다.
..
----------------------------------------------------------------------
Ran 2 tests in 0.068s
OK
하지만 import logging
를 사용하는 경우, 내가 얻을 :
..
----------------------------------------------------------------------
Ran 2 tests in 0.067s
OK
Exception AttributeError: "'NoneType' object has no attribute 'mkstemp'" in <bound method DatastoreFileStub.__del__ of <google.appengine.api.datastore_file_stub.DatastoreFileStub object at 0x101a86750>> ignored
Exception ImportError: 'No module named threading' in <bound method local.__del__ of <_threading_local.local object at 0x103bb4520>> ignored
정리할 수있는 방법이 있습니까? 그것은 밝혀, import os
도 원인, 내 응용 프로그램 코드에서 다음
export TESTING=1
nosetest --with-gae
import os
if not bool(os.environ.get('TESTING')):
import logging
을하지만 :
업데이트
나는 시험 전에 환경 변수를 설정하는 스크립트를 해킹 nosetest
동일한 오류가 발생합니다.
때때로 설명 할 수없는 기수를 사용하여 이상한 오류가 발생합니다 (예 : [this] (http://stackoverflow.com/questions/8108130/gae-kinderror-when-getting-entities-via-listproperty) 및 [this] (http://stackoverflow.com/questions/8966685/picklingerror-cant-pickle-class-its-not-the-same-object-as-in-gae)). 내 코드를 변경하여 주변을 둘러 볼 수 있었지만 매우 불안정하고 불안정했습니다. –
@ 제프 : 이상합니다. 예를 들어, 나는 그 오류를 뱉어내는 코드 스냅 샷을 가지고있다. 필자의 좌절감으로이 코드를 해킹하고 때로는'import'를 움직인다. 때로는 오류가 나타나기도하고 때로는 오류가 올 때도 있습니다. 그리고 내가 포기하고 커밋 되돌림을 사용하지 않고 수동으로 원래의 코드 스냅 샷을 가져 오면 오류가 사라집니다./ – Kit
나는 당신의 고통을 느낍니다.:) –