I split my tests across multiple Python files:
JavaScript
x
5
1
tests
2
├── __init__.py
3
├── test_apples.py
4
└── test_bananas.py.py
5
I import the tests in the ‘__init__.py’ file:
JavaScript
1
3
1
from test_apples import ApplesTest
2
from test_bananas import BananasTest
3
However running Pyflakes on the command-line:
JavaScript
1
2
1
pyflakes .
2
outputs the following errors:
JavaScript
1
3
1
tests/__init__.py:1: [E] PYFLAKES:'ApplesTest' imported but unused
2
tests/__init__.py:2: [E] PYFLAKES:'BananasTest' imported but unused
3
Advertisement
Answer
Add # pyflakes.ignore
comment on every line you want to ignore (in your case import statements).