Partial Merge #11835: Add Travis check for unused Python imports

d60b32074 Add Travis check for unused Python imports (practicalswift)
c7399e708 Remove unused Python imports (practicalswift)

Pull request description:

  Add Travis check for unused Python imports.

  ```
  $ contrib/devtools/lint-python.sh
  ./test/functional/example_test.py:18:1: F401 'test_framework.mininode.NODE_NETWORK' imported but unused
  ./test/functional/test_framework/messages.py:27:1: F401 'test_framework.util.wait_until' imported but unused
  ./test/functional/test_framework/test_framework.py:16:1: F401 'traceback' imported but unused
  ```

Tree-SHA512: 78e50fb1488abe3ebe365e766cb8d6d448cf1bd16c8691e102cb9bf7c202988bdf6e10b25ff772c62e05c72568168462e88cdc7ad98069d9eb3be727735b2d56
This commit is contained in:
MarcoFalke 2017-12-10 18:32:55 -05:00 committed by pasta
parent 9e71390d39
commit cd1fdb5b01
4 changed files with 11 additions and 3 deletions

10
contrib/devtools/lint-python.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
#
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Check for specified flake8 warnings in python files.
# F401: module imported but unused
flake8 --ignore=B,C,E,F,I,N,W --select=F401 .

View File

@ -21,7 +21,6 @@ from test_framework.mininode import (
mininode_lock,
msg_block,
msg_getdata,
NODE_NETWORK,
network_thread_join,
network_thread_start,
)

View File

@ -22,7 +22,7 @@ import struct
import time
from test_framework.siphash import siphash256
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str, wait_until
from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
import dash_hash

View File

@ -15,7 +15,6 @@ import shutil
import sys
import tempfile
import time
import traceback
from concurrent.futures import ThreadPoolExecutor
from .authproxy import JSONRPCException