我们flake8
用来测试我们的代码,并且我们正在使用pytest
fixtures。以下代码:
from staylists.tests.fixtures import fixture1 # noqa: F401
def test_case(fixture1): # noqa: F811
# Test goes here
assert 1 == 1
lib/python/test.py:3:1: F811 redefinition of unused 'fixture1' from line 1
在 linting 期间生成错误。
- 为什么它忽略 noqa 标志?
- 有没有更好的方法来避免标记此错误?