source: test/__init__.py @ 1498:25a5b264907c

Last change on this file since 1498:25a5b264907c was 1498:25a5b264907c, checked in by Stefan Schwarzer <sschwarzer@…>, 7 years ago
Added `from __future__ import unicode_literals`.
File size: 570 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 standalonge `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.