python-编辑器PyCharm

python-编辑器PyCharm


前篇

python 生产力工具


pytest 屏蔽 警告

在单元测试模板 pytest 中, 加入额外参数: --disable-pytest-warnings, 然后跑测试用例就不会显示出警告的日志


配置外部解释器

file -> settings -> project: tools -> project interpreter

选着 show all, 在添加一个 existing environment 的 Python 解释器


添加搜索路径


设置默认测试为 unittests

file -> settings -> tools -> python interated tools, 在 testing 选中 unittests.


重建索引

索引不生效的情况下, 重建一下就好了

  • file -> invalidate caches -> invalidate and restart