Changeset 60ed7d1 in mod_gnutls for test/runtest.py


Ignore:
Timestamp:
Jan 9, 2020, 11:43:02 AM (17 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
ff039b1
Parents:
7e10018
Message:

Allow the prepare_env hook to return a cleanup callback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/runtest.py

    r7e10018 r60ed7d1  
    136136
    137137    # This hook may modify the environment as needed for the test.
     138    cleanup_callback = None
    138139    try:
    139140        if plugin.prepare_env:
    140             plugin.prepare_env()
     141            cleanup_callback = plugin.prepare_env()
    141142    except SkipTest as skip:
    142143        print(f'Skipping: {skip!s}')
     
    148149
    149150    with contextlib.ExitStack() as service_stack:
     151        if cleanup_callback:
     152            service_stack.callback(cleanup_callback)
    150153        service_stack.enter_context(lockfile('test.lock', nolock='MGS_NETNS_ACTIVE' in os.environ))
    151154        service_stack.enter_context(ocsp.run())
Note: See TracChangeset for help on using the changeset viewer.