forked from home-assistant/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to run monkeytype typing on test suite (home-assistant#14440)
* The monkeytype script takes an optional argument to specify a test module or directory to run. Otherwise the whole test suite will run. * Add monkeytype sqlite db to gitignore.
- Loading branch information
1 parent
8c2f0e3
commit 4048ad3
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,3 +107,6 @@ desktop.ini | |
|
||
# Secrets | ||
.lokalise_token | ||
|
||
# monkeytype | ||
monkeytype.sqlite3 |
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
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" |