Skip to content

Commit

Permalink
Merge pull request ivre#504 from p-l-/enh-flake8
Browse files Browse the repository at this point in the history
Add flake8 tests on `ivre` script itself
  • Loading branch information
p-l- authored Apr 8, 2018
2 parents 383dad0 + 2ccefcf commit 634cee7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ before_script:
- export BRO_SAMPLES=`pwd`/usr/local/bro/testing
- ivre --version; echo; bro --version

script: (test "$TRAVIS_PYTHON_VERSION" = 2.6 || (flake8 setup.py && flake8 ivre/ --ignore=E266,E731 && echo "flake8 OK (except E266,E731)")) && cd tests/ && coverage erase && coverage run --parallel-mode tests.py --coverage && coverage combine && coverage report
script: (test "$TRAVIS_PYTHON_VERSION" = 2.6 || (flake8 setup.py && flake8 bin/ivre && flake8 ivre/ --ignore=E266,E731 && echo "flake8 OK (except E266,E731)")) && cd tests/ && coverage erase && coverage run --parallel-mode tests.py --coverage && coverage combine && coverage report

after_success:
- codecov
10 changes: 8 additions & 2 deletions bin/ivre
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@
# You should have received a copy of the GNU General Public License
# along with IVRE. If not, see <http://www.gnu.org/licenses/>.


"""IVRE command line"""


import sys
import os


from ivre import utils, tools
from ivre.tools.version import main as version


HELP_COMMANDS = ["-h", "--help", "h", "help"]
VERSION_COMMANDS = ["-v", "--version"]


def main():
executable = os.path.basename(sys.argv[0])
if executable.startswith("ivre-"):
Expand Down Expand Up @@ -59,7 +64,7 @@ def main():
retcode = 0
else:
output = sys.stderr
output.write("%s command: %s\n\n" % (
output.write("%s command: %s\n\n" % (
"Ambiguous" if possible_commands else "Unknown", command
))
retcode = 1
Expand All @@ -73,6 +78,7 @@ def main():
output.write("\n")
output.write("Try %s help [COMMAND]\n\n" % executable)
exit(retcode)



if __name__ == "__main__":
main()

0 comments on commit 634cee7

Please sign in to comment.