1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 21:51:28 +00:00

Add a test loader script for Zenmap, so tests don't fail with Python <2.7

This commit is contained in:
dmiller
2014-08-23 04:22:09 +00:00
parent 552b0bf226
commit b75df9d8f9
2 changed files with 19 additions and 1 deletions

18
zenmap/test/run_tests.py Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env python
import unittest
if __name__ == "__main__":
import sys
import glob
import os
if not hasattr(unittest.defaultTestLoader, "discover"):
print("Python unittest discovery missing. Requires Python 2.7 or newer.")
sys.exit(0)
os.chdir("..")
suite = unittest.defaultTestLoader.discover(
start_dir=glob.glob("build/lib.*")[0],
pattern="*.py"
)
unittest.TextTestRunner().run(suite)