Eric's Studio

ARTS078

Word count: 74Reading time: 1 min
2022/12/03

click to see more!

Algorithm

Review

Tips

PATH issue with pytest ‘ImportError: No module named YadaYadaYada’

尝试使用 Pytest 进行单元测试。发现 PythonPath 会有问题。

有点像 Java 中的 Classpath。

python -m pytest 这样使用才会把当前路径加入到 PythonPath 中,或者就按照 pytest 的用法,通过 configfile 来控制 PythonPath

Share

CATALOG
  1. 1. Algorithm
  2. 2. Review
  3. 3. Tips
  4. 4. Share