Changeset b0695c6 in mod_gnutls for test/runtest.py


Ignore:
Timestamp:
Apr 7, 2020, 2:44:48 PM (15 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
0484b31
Parents:
1a85a3d
Message:

Pass parsed YAML config to mgstest.tests.run_test_conf

Parsing the config in runtest.py has the advantage that the parsed
config is available there, too, e.g. to be read by hooks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/runtest.py

    r1a85a3d rb0695c6  
    2222import sys
    2323import tempfile
     24import yaml
    2425from unittest import SkipTest
    2526
     
    100101    os.environ['TEST_NAME'] = testname
    101102
     103    # Load test config
     104    try:
     105        with open(os.path.join(testdir, 'test.yml'), 'r') as conf_file:
     106            test_conf = yaml.load(conf_file, Loader=yaml.Loader)
     107    except FileNotFoundError:
     108        test_conf = None
     109
    102110    # Load test case hooks (if any)
    103111    plugin_path = os.path.join(testdir, 'hooks.py')
     
    194202                                  response_log=args.log_responses)
    195203        else:
    196             with open(os.path.join(testdir, 'test.yml'), 'r') as test_conf:
    197                 run_test_conf(test_conf,
    198                               float(os.environ.get('TEST_QUERY_TIMEOUT', 5.0)),
    199                               conn_log=args.log_connection,
    200                               response_log=args.log_responses)
     204            run_test_conf(test_conf,
     205                          float(os.environ.get('TEST_QUERY_TIMEOUT', 5.0)),
     206                          conn_log=args.log_connection,
     207                          response_log=args.log_responses)
    201208
    202209    # run extra checks the test's hooks.py might define
Note: See TracChangeset for help on using the changeset viewer.