'jsonschema' imported but unused
Bug #1695918 reported by
Joshua Powers
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
From latest build tests:
tests/unittests
tests/unittests
Steps to reproduce:
# git clone master
# cd cloud-init
# tox -e tip-pyflakes
The offending code in both files is:
try:
import jsonschema # NOQA
_missing_
except ImportError:
_missing_
To post a comment you must log in.
The NOQA comment does not appear to work across pyflakes and flake8. A better solution is to assert the import right after to avoid needing to make exceptions for both linters & checkers.
My suggestion:
try: jsonschema_ dep = False
import jsonschema
assert jsonschema
_missing_