diff options
author | Joshua Powers <josh.powers@canonical.com> | 2017-06-07 14:39:18 -0600 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-06-07 17:22:13 -0400 |
commit | 8d58f12248c0bd9e8f88296f29935fd3dc33b415 (patch) | |
tree | f1edfe5d16091da23d4e4087d80f35e5e7809b39 /tests/unittests/test_handler/test_handler_ntp.py | |
parent | 802e7cb2da8e2d0225525160e6edd6b58b275b8c (diff) | |
download | vyos-cloud-init-8d58f12248c0bd9e8f88296f29935fd3dc33b415.tar.gz vyos-cloud-init-8d58f12248c0bd9e8f88296f29935fd3dc33b415.zip |
test: Fix pyflakes complaint of unused import.
The jsonschema package is used only when available, but the lint
check thinks the import is unused across pyflakes and flake8. In
order to avoid having exceptions for both assert that the import
works right after and the import is considered used.
The '# NOQA' doesn't affect pyflakes (only flake8).
LP: #1695918
Diffstat (limited to 'tests/unittests/test_handler/test_handler_ntp.py')
-rw-r--r-- | tests/unittests/test_handler/test_handler_ntp.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unittests/test_handler/test_handler_ntp.py b/tests/unittests/test_handler/test_handler_ntp.py index 25d7365a..3a9f7f7e 100644 --- a/tests/unittests/test_handler/test_handler_ntp.py +++ b/tests/unittests/test_handler/test_handler_ntp.py @@ -17,7 +17,8 @@ pools {{pools}} """ try: - import jsonschema # NOQA + import jsonschema + assert jsonschema # avoid pyflakes error F401: import unused _missing_jsonschema_dep = False except ImportError: _missing_jsonschema_dep = True |