Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

The modification to setup.py gives the option of --no-gui for the com…

…mand

"test", which is passed to Tests/run_tests.py as an argument. The modification
to run_tests.py includes changing argv from being sys.argv by default to
sys.argv[1:] by default, which is more conventional, and also easier to
substitute for cases such as this where run_test.main() is called externally.
  • Loading branch information...
commit 1d16b653b164cd120dfcdd462f298c31f2ecce8a 1 parent b3bbfdb
lasher authored
Showing with 17 additions and 7 deletions.
  1. +2 −2 Tests/run_tests.py
  2. +15 −5 setup.py
View
4 Tests/run_tests.py
@@ -56,7 +56,7 @@ def main(argv):
# get the command line options
try:
- opts, args = getopt.getopt(argv[1:], 'g',
+ opts, args = getopt.getopt(argv, 'g',
["generate", "no-gui", "help"])
except getopt.error, msg:
print msg
@@ -316,5 +316,5 @@ def convert_string_newlines(line):
return line
if __name__ == "__main__":
- sys.exit(main(sys.argv))
+ sys.exit(main(sys.argv[1:]))
View
20 setup.py
@@ -238,11 +238,18 @@ class test_biopython(Command):
"""
description = "Automatically run the test suite for Biopython."
- user_options = [] # distutils complains if this is not here.
- def initialize_options(self): # distutils wants this
- pass
- def finalize_options(self): # this too
+
+ user_options = [
+ # provide the option to run tests in no-gui mode
+ ('no-gui', None, "Do not run in GUI mode")
+ ]
+
+ def initialize_options(self):
+ self.no_gui = None
+
+ def finalize_options(self):
pass
+
def run(self):
this_dir = os.getcwd()
@@ -250,7 +257,10 @@ def run(self):
os.chdir("Tests")
sys.path.insert(0, '')
import run_tests
- run_tests.main([])
+ if self.no_gui:
+ run_tests.main(['--no-gui'])
+ else:
+ run_tests.main([])
# change back to the current directory
os.chdir(this_dir)
Please sign in to comment.
Something went wrong with that request. Please try again.