1 | n/a | # Convenience test module to run all of the OpenSSL-related tests in the |
---|
2 | n/a | # standard library. |
---|
3 | n/a | |
---|
4 | n/a | import ssl |
---|
5 | n/a | import sys |
---|
6 | n/a | import subprocess |
---|
7 | n/a | |
---|
8 | n/a | TESTS = [ |
---|
9 | n/a | 'test_asyncio', 'test_ensurepip.py', 'test_ftplib', 'test_hashlib', |
---|
10 | n/a | 'test_hmac', 'test_httplib', 'test_imaplib', 'test_nntplib', |
---|
11 | n/a | 'test_poplib', 'test_ssl', 'test_smtplib', 'test_smtpnet', |
---|
12 | n/a | 'test_urllib2_localnet', 'test_venv', 'test_xmlrpc' |
---|
13 | n/a | ] |
---|
14 | n/a | |
---|
15 | n/a | def run_regrtests(*extra_args): |
---|
16 | n/a | print(ssl.OPENSSL_VERSION) |
---|
17 | n/a | args = [ |
---|
18 | n/a | sys.executable, |
---|
19 | n/a | '-Werror', '-bb', # turn warnings into exceptions |
---|
20 | n/a | '-m', 'test', |
---|
21 | n/a | ] |
---|
22 | n/a | if not extra_args: |
---|
23 | n/a | args.extend([ |
---|
24 | n/a | '-r', # randomize |
---|
25 | n/a | '-w', # re-run failed tests with -v |
---|
26 | n/a | '-u', 'network', # use network |
---|
27 | n/a | '-u', 'urlfetch', # download test vectors |
---|
28 | n/a | '-j', '0' # use multiple CPUs |
---|
29 | n/a | ]) |
---|
30 | n/a | else: |
---|
31 | n/a | args.extend(extra_args) |
---|
32 | n/a | args.extend(TESTS) |
---|
33 | n/a | result = subprocess.call(args) |
---|
34 | n/a | sys.exit(result) |
---|
35 | n/a | |
---|
36 | n/a | if __name__ == '__main__': |
---|
37 | n/a | run_regrtests(*sys.argv[1:]) |
---|