Skip to content

Commit 376848c

Browse files
committed
Update script/test
Don't use `--` prefixes for selecting the tests to be executed. Add an option to exeute the rate-limit tests.
1 parent a70c859 commit 376848c

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

script/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This is typically run after an initial clone, or, to _reset_ the project back to
3939

4040
[`script/test`][test] Run the test suite for this project.
4141

42-
This script implements `--lint` and `--test` command line options to enable you to select and run only the code linting or the package tests (by default, both are run when you execute `script/test` without any command line arguments).
42+
This script implements `lint`, `tests`, and `ratelimiting` command line options to enable you to select and run only the code linting or the package tests (by default, both are run when you execute `script/test` without any command line arguments).
4343

4444

4545
### script/build

script/test

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@
66

77

88
# Run all tests by default
9-
all=true
9+
default=true
1010

1111

1212
# Process Script Arguments
1313
for i in ${@}; do
1414
case ${i} in
15-
--lint)
15+
lint)
1616
lint=true
17-
all=
17+
default=
1818
;;
1919

20-
--test)
21-
test=true
22-
all=
20+
tests)
21+
tests=true
22+
default=
23+
;;
24+
25+
ratelimiting)
26+
ratelimiting=true
27+
default=
2328
;;
2429

2530
*)
@@ -35,13 +40,19 @@ cd "$(dirname "$0")/.."
3540

3641

3742
# Lint the source code
38-
if [ ${all} ] || [ ${lint} ]; then
43+
if [ ${default} ] || [ ${lint} ]; then
3944
echo "==> Linting the source code"
4045
flake8
4146
fi
4247

4348
# Run the test suite
44-
if [ ${all} ] || [ ${test} ]; then
49+
if [ ${default} ] || [ ${tests} ]; then
4550
echo "==> Running the test suite"
4651
py.test -s -m "not ratelimit"
4752
fi
53+
54+
# Run the rate-limit tests
55+
if [ ${ratelimiting} ]; then
56+
echo "==> Running the rate-limit tests"
57+
py.test -s -m "ratelimit"
58+
fi

0 commit comments

Comments
 (0)