Skip to content

Commit c680921

Browse files
committed
Enforce running run_tests under tox by setting/checking an env var
--HG-- extra : rebase_source : c7d4e82a995e79c35152190c2847aea53ee8e3cf
1 parent 8ebd00f commit c680921

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/run_tests

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/sh
22

3-
##
4-
## ONLY RUN THIS VIA TOX
5-
##
6-
73
#set -x
84

5+
if [ -z "$TOXIC" ]
6+
then
7+
echo "Only run this via tox" 1>&2
8+
exit 1
9+
fi
10+
911
envdir="$1"
1012
shift
1113
scripts="$*"

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ envlist = py27,py26,py32
44
[testenv]
55
commands = bash ./tests/run_tests {envdir} []
66
deps = virtualenv
7+
setenv =
8+
TOXIC = true
79

810
# Not sure why this is needed, but on my system if it isn't included then
911
# the python version picked up for 2.6 is actually 2.7.

0 commit comments

Comments
 (0)