Changeset 9a48691 in mod_gnutls for test/runtest.py


Ignore:
Timestamp:
Jan 8, 2020, 3:32:30 PM (16 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master, proxy-ticket
Children:
baa0056
Parents:
dda0f4a
Message:

Test suite: Support checking preconditions in prepare_env hook

The hook may now raise unittest.SkipTest? to skip the test case if any
preconditions (e.g. availability of a certain Apache module) are not
met.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/runtest.py

    rdda0f4a r9a48691  
    2222import sys
    2323import tempfile
     24from unittest import SkipTest
    2425
    2526import mgstest.hooks
     
    131132
    132133    # This hook may modify the environment as needed for the test.
    133     if plugin.prepare_env:
    134         plugin.prepare_env()
     134    try:
     135        if plugin.prepare_env:
     136            plugin.prepare_env()
     137    except SkipTest as skip:
     138        print(f'Skipping: {skip!s}')
     139        sys.exit(77)
    135140
    136141    # If VERBOSE is enabled, log the HTTPD build configuration
Note: See TracChangeset for help on using the changeset viewer.