我正在使用 pytest-bdd
这是我的功能文件
#recon_test.feature
Feature: This is used to run recon
Scenarios:Run Recon
测试文件'''python #recon_test.py
Class Recon_Tests():
@scenario('recon_test.feature','Run Recon')
def test_run_recon(self):
#do something
when i run this using command pytest , i get error **fixture 'self' not found.**
Because due to scenario annotation it treats this function as fixture maybe , and expects **'self'** to be another fixture.
I want to use the '@scenario' in my test functions inside the test classes . Is there any way ?
Also , i have found a workaround for this , i have created a fixture
```python
def self():
pass
避免这种情况,错误就消失了。
但它给出了另一个错误,说“Recon_Tests”没有属性配置。
当 bdd 尝试读取夹具的配置对象以获取预测试挂钩时。
请建议