0
运行模块级py.test灯具说我有这样的不上的每个子模块
$ tree
.
├── A
│ ├── __init__.py
│ ├── conftest.py
│ ├── test_set_1.py
│ └── test_set_2.py
├── B
│ ├── __init__.py
│ ├── conftest.py
│ ├── test_set_1.py
│ └── test_set_2.py
├── C
│ ├── __init__.py
│ ├── conftest.py
│ ├── test_set_1.py
│ └── test_set_2.py
├── conftest.py
├── pytest.ini
我想定义一个pytest
夹具,我可以指定一次特定运行的目录结构顶层模块(A
,B
,或C
),却一次也没有为每个子模块(test_set_1.py
,test_set_2.py
等)
我怎样才能做到这一点?我可以以某种方式在__init__.py
文件中注入这些依赖关系吗?