diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2018-09-17 18:48:29 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2018-09-17 18:48:29 -0700 |
commit | 30d49449e38cb10a254983605d576d48a76a387b (patch) | |
tree | 4b1231b1a8a33c73659ef178878f3016c523b4c3 /tests/util.py | |
parent | 75e6c377089c949df19b497fd9ba408ca82628c2 (diff) | |
parent | dc82971c1af0d147433c948dc440ffabdc276a7c (diff) |
Merge branch '2.2' into 2.3
Diffstat (limited to 'tests/util.py')
-rw-r--r-- | tests/util.py | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/tests/util.py b/tests/util.py index c1b43da8..c1ba4b2c 100644 --- a/tests/util.py +++ b/tests/util.py @@ -1,6 +1,27 @@ -import os +from os.path import dirname, realpath, join -root_path = os.path.dirname(os.path.realpath(__file__)) +import pytest -def test_path(filename): - return os.path.join(root_path, filename) +from paramiko.py3compat import builtins + + +def _support(filename): + return join(dirname(realpath(__file__)), filename) + + +# TODO: consider using pytest.importorskip('gssapi') instead? We presumably +# still need CLI configurability for the Kerberos parameters, though, so can't +# JUST key off presence of GSSAPI optional dependency... +# TODO: anyway, s/True/os.environ.get('RUN_GSSAPI', False)/ or something. +needs_gssapi = pytest.mark.skipif(True, reason="No GSSAPI to test") + + +def needs_builtin(name): + """ + Skip decorated test if builtin name does not exist. + """ + reason = "Test requires a builtin '{0}'".format(name) + return pytest.mark.skipif(not hasattr(builtins, name), reason=reason) + + +slow = pytest.mark.slow |