Invoke pytest from python for current module only : <p>I know that py.test can test a single module if I do:</p>

<pre><code>py.test mod1.py
</code></pre>

<p>Or, I can invoke pytest inside python:</p>

<pre><code>import pytest
pytest.run(['mod1.py'])
</code></pre>

<p>Can I do it inside python, and let it to run the current module? I guess I can do:</p>

<pre><code>import pytest
import os
pytest.main([os.path.basename(__file__)])
</code></pre>

<p>But wonder whether this is the most "pythonic" way to do it. Thanks!</p>
