Created
May 15, 2013 14:51
-
-
Save ignacysokolowski/5584572 to your computer and use it in GitHub Desktop.
Shell function for running PyTest with coverage and linting on specified application part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run PyTest with coverage and linting on specified application part. | |
# | |
# Useful shortcut when you're working at one class/function/module and you | |
# don't want to run all your tests and need to measure coverage only for what | |
# you're currently testing. | |
# | |
# Example:: | |
# | |
# $ test_part tests/test_views.py app/views.py -vsk LoginView | |
# | |
# 1st param: file or directory with tests to run | |
# 2nd param: path to measure coverage for | |
# Any additional params will be added as py.test params | |
test_part () { | |
py.test --cov $2 --cov-report term-missing --cov-report html --pep8 --flakes $1 ${@:3} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment