擅长:python、mysql、java
<p>我已经在<code>/App/App</code>目录中有一个<code>__init__.py</code>文件,并且希望从项目根目录运行测试,而不使用任何路径损坏魔法:</p>
<pre><code> python -m pytest tests
</code></pre>
<p>输出立即如下所示:</p>
<pre><code>➟ python -m pytest tests
====================================== test session starts ======================================
platform linux -- Python 3.5.1, pytest-2.9.0, py-1.4.31, pluggy-0.3.1
rootdir: /home/andrew/code/app, inifile:
plugins: teamcity-messages-1.17
collected 46 items
... lines omitted ...
============================= 44 passed, 2 skipped in 1.61 seconds ==============================
</code></pre>