source: test/__init__.py @ 1463:236791277fad

Last change on this file since 1463:236791277fad was 1463:236791277fad, checked in by Stefan Schwarzer <sschwarzer@…>, 7 years ago
Added `__all__` in `test/__init__.py`.
File size: 529 bytes
Line 
1"""
2Setup for unit tests.
3"""
4
5import os
6import unittest
7
8
9__all__ = ["skip_long_running_test"]
10
11
12def skip_long_running_test_condition():
13    """
14    Helper function to use with `unittest.skipIf`.
15
16    This requires either Python >= 2.7 or the standalonge `unittest2`
17    module.
18    """
19    skip_flag = os.environ.get("SKIP_LONG_RUNNING_TESTS", "0")
20    return skip_flag == "1"
21
22
23skip_long_running_test = unittest.skipIf(skip_long_running_test_condition(),
24                                         "skipping long-running test")
Note: See TracBrowser for help on using the repository browser.