summaryrefslogtreecommitdiffhomepage
path: root/tests/util.py
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-10-23 11:31:03 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-10-23 11:31:03 -0700
commit385856db1bd2a2db7c5dd922a6e74d8e63082303 (patch)
tree278287470408c016b51ee21d9fcd50bc7569b6a0 /tests/util.py
parentb9ff5f3e4b11a7b8928e51629df0bfde4c6ebe53 (diff)
Import cleanup, mostly focused on s/tests/./
Diffstat (limited to 'tests/util.py')
-rw-r--r--tests/util.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/util.py b/tests/util.py
index 55aedc98..db1f077c 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -1,6 +1,23 @@
-import os
+from os.path import dirname, realpath, join
+
+import pytest
+
+from paramiko.py3compat import builtins
-root_path = os.path.dirname(os.path.realpath(__file__))
def _support(filename):
- return os.path.join(root_path, 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.
+ """
+ return pytest.mark.skipif(not hasattr(builtins, name))