Pycharm py.test 覆盖范围 'Coverage' 对象没有属性 'export'
Pycharm py.test coverage 'Coverage' object has no attribute 'export'
我正在尝试 运行 py.test 并在 pycharm 中进行报道。在我的家用电脑上它就像一个魅力,但是在我的笔记本电脑上我得到这个堆栈跟踪
/home/david/PycharmProjects/pyCardDeck/virtualenv/bin/python /opt/pycharm/helpers/coverage_runner/run_coverage.py run --omit=\"/opt/pycharm/helpers*\" /opt/pycharm/helpers/pycharm/pytestrunner.py -p pytest_teamcity /home/david/PycharmProjects/pyCardDeck tests
Testing started at 13:15 ...
============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.0.1, py-1.4.31, pluggy-0.3.1
rootdir: /home/david/PycharmProjects/pyCardDeck, inifile:
plugins: cov-2.3.1
collected 35 items
tests/test_card.py ..
tests/test_deck.py ..............................Traceback (most recent call last):
File "/opt/pycharm/helpers/coverage_runner/run_coverage.py", line 44, in <module>
main()
File "/home/david/PycharmProjects/pyCardDeck/virtualenv/lib/python3.5/site-packages/coverage/cmdline.py", line 753, in main
...
========================== 35 passed in 0.89 seconds ===========================
status = CoverageScript().command_line(argv)
File "/home/david/PycharmProjects/pyCardDeck/virtualenv/lib/python3.5/site-packages/coverage/cmdline.py", line 480, in command_line
return self.do_run(options, args)
File "/home/david/PycharmProjects/pyCardDeck/virtualenv/lib/python3.5/site-packages/coverage/cmdline.py", line 638, in do_run
self.coverage.export()
AttributeError: 'Coverage' object has no attribute 'export'
Process finished with exit code 1
运行 py.test --cov 手动工作,所以它是 Pycharm 魔法中的东西。我的笔记本电脑是 运行 Pycharm 2016.1.4 和覆盖范围 4.2
cmdline.py 中的那一行应该读作 self.coverage.save()
。从来没有说过export
。您应该重新安装 coverage.py。我不知道是什么改变了它。
我正在尝试 运行 py.test 并在 pycharm 中进行报道。在我的家用电脑上它就像一个魅力,但是在我的笔记本电脑上我得到这个堆栈跟踪
/home/david/PycharmProjects/pyCardDeck/virtualenv/bin/python /opt/pycharm/helpers/coverage_runner/run_coverage.py run --omit=\"/opt/pycharm/helpers*\" /opt/pycharm/helpers/pycharm/pytestrunner.py -p pytest_teamcity /home/david/PycharmProjects/pyCardDeck tests
Testing started at 13:15 ...
============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.0.1, py-1.4.31, pluggy-0.3.1
rootdir: /home/david/PycharmProjects/pyCardDeck, inifile:
plugins: cov-2.3.1
collected 35 items
tests/test_card.py ..
tests/test_deck.py ..............................Traceback (most recent call last):
File "/opt/pycharm/helpers/coverage_runner/run_coverage.py", line 44, in <module>
main()
File "/home/david/PycharmProjects/pyCardDeck/virtualenv/lib/python3.5/site-packages/coverage/cmdline.py", line 753, in main
...
========================== 35 passed in 0.89 seconds ===========================
status = CoverageScript().command_line(argv)
File "/home/david/PycharmProjects/pyCardDeck/virtualenv/lib/python3.5/site-packages/coverage/cmdline.py", line 480, in command_line
return self.do_run(options, args)
File "/home/david/PycharmProjects/pyCardDeck/virtualenv/lib/python3.5/site-packages/coverage/cmdline.py", line 638, in do_run
self.coverage.export()
AttributeError: 'Coverage' object has no attribute 'export'
Process finished with exit code 1
运行 py.test --cov 手动工作,所以它是 Pycharm 魔法中的东西。我的笔记本电脑是 运行 Pycharm 2016.1.4 和覆盖范围 4.2
cmdline.py 中的那一行应该读作 self.coverage.save()
。从来没有说过export
。您应该重新安装 coverage.py。我不知道是什么改变了它。