source: test/__init__.py @ 1433:a98861420c5f

Last change on this file since 1433:a98861420c5f was 1433:a98861420c5f, checked in by schwa, 7 years ago
Defined own decorator for skipping long-running tests to avoid code duplication.
File size: 459 bytes
Line 
1import os
2import unittest
3
4
5def skip_long_running_test_condition():
6    """
7    Helper function to use with `unittest.skipIf`.
8
9    This requires either Python >= 2.7 or the standalonge `unittest2`
10    module.
11    """
12    skip_flag = os.environ.get("SKIP_LONG_RUNNING_TESTS", "0")
13    return skip_flag == "1"
14
15
16skip_long_running_test = unittest.skipIf(skip_long_running_test_condition(),
17                                         "skipping long-running test")
Note: See TracBrowser for help on using the repository browser.