summaryrefslogtreecommitdiff
path: root/test/run.py
diff options
context:
space:
mode:
authorAdam Hupp <adam@hupp.org>2022-04-25 06:47:40 -0700
committerAdam Hupp <adam@hupp.org>2022-04-25 06:55:20 -0700
commit6b34bde052be74334dad71963d92a1c49eecd168 (patch)
tree586d4ff533a2d486bff65a26e237b2516fa11973 /test/run.py
parent0fb1922da4a7b27bd19b75a03dca2f51bff4362f (diff)
downloadpython-magic-6b34bde052be74334dad71963d92a1c49eecd168.tar.gz
improve test script name clarity; expand test docs; cleanup docker run script
Diffstat (limited to 'test/run.py')
-rw-r--r--test/run.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/test/run.py b/test/run.py
deleted file mode 100644
index cf62eee..0000000
--- a/test/run.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import subprocess
-import os.path
-import sys
-
-this_dir = os.path.dirname(sys.argv[0])
-
-new_env = dict(os.environ)
-new_env.update({
- 'LC_ALL': 'en_US.UTF-8',
- 'PYTHONPATH': os.path.join(this_dir, ".."),
-})
-
-
-def has_py(version):
- ret = subprocess.run("which %s" % version, shell=True, stdout=subprocess.DEVNULL)
- return ret.returncode == 0
-
-
-def run_test(versions):
- found = False
- for i in versions:
- if not has_py(i):
- # if this version doesn't exist in path, skip
- continue
- found = True
- print("Testing %s" % i)
- subprocess.run([i, os.path.join(this_dir, "test.py")], env=new_env, check=True)
- subprocess.run([i, os.path.join(this_dir, "libmagic_test.py")], env=new_env, check=True)
-
- if not found:
- sys.exit("No versions found: " + str(versions))
-
-run_test(["python2", "python2.7"])
-run_test(["python3.5", "python3.6", "python3.7", "python3.8", "python3.9"])
-