在远程目录中的pyc文件上运行py.test

时间:2015-10-21 10:31:38

标签: pytest

是否可以在当前目录以外的目录上运行py.test,只显示* .pyc文件?

我已尝试过python_files ini设置,并设置root目录。我还需要从我的脚本中启动py.test(不使用py.test可执行文件)。

代码的相关部分如下:

[pytest]
DJANGO_SETTINGS_MODULE=myproject.settings
python_files=test_*.pyc

def main_test(args):
    dirname = os.path.dirname(__file__)
    return pytest.main(args=[dirname])

其中dirname包含myproject模块的目录。这不是当前工作的目录。我也嵌入了python。

我错过了一些明显的东西吗?

0 个答案:

没有答案
相关问题