From e56fb8f62f60128033e518b0266df2e825f6323d Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 22 Sep 2016 16:53:15 +0200 Subject: [PATCH] Add Lib/test/ssltests.py for faster testing of OpenSSL --- Lib/test/ssltests.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Lib/test/ssltests.py diff --git a/Lib/test/ssltests.py b/Lib/test/ssltests.py new file mode 100644 index 0000000000..36561b96d1 --- /dev/null +++ b/Lib/test/ssltests.py @@ -0,0 +1,36 @@ +# Convenience test module to run all of the OpenSSL-related tests in the +# standard library. + +import ssl +import sys +import subprocess + +TESTS = [ + 'test_ensurepip.py', 'test_ftplib', 'test_hashlib', + 'test_hmac', 'test_httplib', 'test_imaplib', 'test_nntplib', + 'test_poplib', 'test_ssl', 'test_smtplib', 'test_smtpnet', + 'test_urllib2_localnet', 'test_xmlrpc' +] + +def run_regrtests(*extra_args): + print(ssl.OPENSSL_VERSION) + args = [ + sys.executable, + '-Werror', '-bb', # turn warnings into exceptions + '-m', 'test.regrtest', + ] + if not extra_args: + args.extend([ + '-r', # randomize + '-w', # re-run failed tests with -v + '-u', 'network', # use network + '-u', 'urlfetch', # download test vectors + ]) + else: + args.extend(extra_args) + args.extend(TESTS) + result = subprocess.call(args) + sys.exit(result) + +if __name__ == '__main__': + run_regrtests(*sys.argv[1:]) -- 2.50.1