source: test/__init__.py @ 1662:db924600a3c3

Last change on this file since 1662:db924600a3c3 was 1565:a48f63e7ca64, checked in by Philippe Ombredanne, 6 years ago
Fixed minor typos
File size: 569 bytes
Line 
1"""
2Setup for unit tests.
3"""
4
5from __future__ import unicode_literals
6
7import os
8import unittest
9
10
11__all__ = ["skip_long_running_test"]
12
13
14def skip_long_running_test_condition():
15    """
16    Helper function to use with `unittest.skipIf`.
17
18    This requires either Python >= 2.7 or the standalone `unittest2`
19    module.
20    """
21    skip_flag = os.environ.get("SKIP_LONG_RUNNING_TESTS", "0")
22    return skip_flag == "1"
23
24
25skip_long_running_test = unittest.skipIf(skip_long_running_test_condition(),
26                                         "skipping long-running test")
Note: See TracBrowser for help on using the repository browser.