diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2017-02-02 01:53:50 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2017-02-02 01:53:50 +0000 |
commit | f24de0357ff4472aa8bb283980ea27b3ddd722e4 (patch) | |
tree | 70021306cd0905879dcb027034aaf1bf3a4824c2 /tests/testutils.py | |
parent | 9ca51e0ed921270b2c641959ffeeb2ca9f58809b (diff) | |
download | psycopg2-f24de0357ff4472aa8bb283980ea27b3ddd722e4.tar.gz |
Allow skipping the slow testmanylinux
It's not so much about tests being slow: some just get stuck and timeout
travis.
Skipped all tests taking about more than 0.2s to run on my laptop.
Fast testing takes about 8s instead of 24.
Diffstat (limited to 'tests/testutils.py')
-rw-r--r-- | tests/testutils.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/testutils.py b/tests/testutils.py index 9347735..b34a5a8 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -447,7 +447,6 @@ def script_to_py3(script): class py3_raises_typeerror(object): - def __enter__(self): pass @@ -455,3 +454,13 @@ class py3_raises_typeerror(object): if sys.version_info[0] >= 3: assert type is TypeError return True + + +def slow(f): + """Decorator to mark slow tests we may want to skip""" + @wraps(f) + def slow_(self): + if os.environ.get('PSYCOPG2_TEST_FAST'): + return self.skipTest("slow test") + return f(self) + return slow_ |