此命令不会结束,因为它在非常深的大数据目录中搜索:
py.test --full-trace -k my_test_name
stat("/home/conftest.py", 0x7ffff5e6f1a0) = -1 ENOENT (No such file or directory)
stat("/home/foo3_bar_p/conftest.py", 0x7ffff5e6f1a0) = -1 ENOENT (No such file or directory)
stat("/home/foo3_bar_p/archiv/conftest.py", 0x7ffff5e6f1a0) = -1 ENOENT (No such file or directory)
stat("/home/foo3_bar_p/archiv/specialworkflow/conftest.py", 0x7ffff5e6f1a0) = -1 ENOENT (No such file or directory)
stat("/home/foo3_bar_p/archiv/specialworkflow/239/conftest.py", 0x7ffff5e6f1a0) = -1 ENOENT (No such file or directory)
stat("/home/foo3_bar_p/archiv/specialworkflow/239/57x/conftest.py", 0x7ffff5e6f1a0) = -1 ENOENT (No such file or directory)
stat("/home/foo3_bar_p/archiv/specialworkflow/239/75x", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat("/home/foo3_bar_p/archiv/specialworkflow/239/75x", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
^{__init__.py
文件。为什么py test扫描这个大目录?在
因为pytest在测试中不需要
__init__.py
文件。在如果您不希望它扫描目录,请将路径传递给pytest,或者将其添加到^{} 。在
相关问题 更多 >
编程相关推荐