Context
The file app/main.py imports the math module at the top, but it is never used anywhere in the file. Unused imports add clutter and can confuse readers about what dependencies the module actually has.
Steps to reproduce
- Open
app/main.py.
- Find line 7:
import math
- Search the file for any usage of
math. -- there are none.
- If you have a linter like
flake8 or ruff, it will flag this:
pip install ruff
ruff check app/main.py
Output: F401 'math' imported but unused
Expected behavior
Only modules that are actually used should be imported.
Actual behavior
import math is present but never used.
Files
Acceptance criteria
Suggested approach
- Open
app/main.py.
- Delete the
import math line.
- Run
pytest tests/ -v to verify nothing depended on it.
Context
The file
app/main.pyimports themathmodule at the top, but it is never used anywhere in the file. Unused imports add clutter and can confuse readers about what dependencies the module actually has.Steps to reproduce
app/main.py.import mathmath.-- there are none.flake8orruff, it will flag this:F401 'math' imported but unusedExpected behavior
Only modules that are actually used should be imported.
Actual behavior
import mathis present but never used.Files
app/main.py-- line 7Acceptance criteria
import mathline is removed fromapp/main.pypytest tests/ -vSuggested approach
app/main.py.import mathline.pytest tests/ -vto verify nothing depended on it.