Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to run monkeytype typing on test suite #14440

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ desktop.ini

# Secrets
.lokalise_token

# monkeytype
monkeytype.sqlite3
25 changes: 25 additions & 0 deletions script/monkeytype
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
# Run monkeytype on test suite or optionally on a test module or directory.

# Stop on errors
set -e

cd "$(dirname "$0")/.."

command -v pytest >/dev/null 2>&1 || {
echo >&2 "This script requires pytest but it's not installed." \
"Aborting. Try: pip install pytest"; exit 1; }

command -v monkeytype >/dev/null 2>&1 || {
echo >&2 "This script requires monkeytype but it's not installed." \
"Aborting. Try: pip install monkeytype"; exit 1; }

if [ $# -eq 0 ]
then
echo "Run monkeytype on test suite"
monkeytype run "`command -v pytest`"
exit
fi

echo "Run monkeytype on tests in $1"
monkeytype run "`command -v pytest`" "$1"