2011-03-31 3 views
0

오늘 nosetests를 사용하기 시작했는데 내가 시도 할 때까지 모든 것이 잘 작동 : 권한 거부 오류가 발생하고 나는 표준 라이브러리 패키지에 쓰기를 시도 왜 이해가 안코가 테스트 커버리지 권한 오류

nosetests --with-coverage --cover-html --cover-html-dir=/tmp/cache :

Traceback (most recent call last): 
    File "/usr/bin/nosetests", line 8, in <module> 
    load_entry_point('nose==0.11.1', 'console_scripts', 'nosetests')() 
    File "/usr/lib/pymodules/python2.6/nose/core.py", line 113, in __init__ 
    argv=argv, testRunner=testRunner, testLoader=testLoader) 
    File "/usr/lib/python2.6/unittest.py", line 817, in __init__ 
    self.runTests() 
    File "/usr/lib/pymodules/python2.6/nose/core.py", line 192, in runTests 
    result = self.testRunner.run(self.test) 
    File "/usr/lib/pymodules/python2.6/nose/core.py", line 63, in run 
    result.printErrors() 
    File "/usr/lib/pymodules/python2.6/nose/result.py", line 88, in printErrors 
    self.config.plugins.report(self.stream) 
    File "/usr/lib/pymodules/python2.6/nose/plugins/manager.py", line 82, in __call__ 
    return self.call(*arg, **kw) 
    File "/usr/lib/pymodules/python2.6/nose/plugins/manager.py", line 150, in simple 
    result = meth(*arg, **kw) 
    File "/usr/lib/pymodules/python2.6/nose/plugins/cover.py", line 168, in report 
    coverage.annotate(files.values()) 
    File "/usr/lib/python2.6/dist-packages/coverage.py", line 995, in annotate 
    return the_coverage.annotate(*args, **kw) 
    File "/usr/lib/python2.6/dist-packages/coverage.py", line 906, in annotate 
    self.annotate_file(filename, statements, excluded, missing, directory) 
    File "/usr/lib/python2.6/dist-packages/coverage.py", line 921, in annotate_file 
    dest = open(dest_file, 'w') 
IOError: [Errno 13] Permission denied: '/usr/lib/python2.6/email/iterators.py,cover' 

답변

0

나는 내가 --cover-package= 인수를 사용할 수 있다는 것을 발견 나는 보험 보상을 원했던 패키지의 이름으로

4

노브 스위치가 구식입니다. 먼저 코를 실행하는 경우 그런 다음 HTML 생성하기 위해 직접 범위를 사용, 결과에 행복 할 것 :

$ nosetests --with-coverage 
$ coverage html 

열기 htmlcov을/index.html을