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>2018-09-17 14:15:32 -0700
commit6a4233be4bcddf480dd3d5ef96cdc8f39ad16795 (patch)
tree71471d725b6ad0d95361bb8dece58781374c0372 /tests/util.py
parent6b96afd1d32316b0be3c28d3b5d298493086de27 (diff)
Import cleanup, mostly focused on s/tests/./
Diffstat (limited to 'tests/util.py')
-rw-r--r--tests/util.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/util.py b/tests/util.py
index bde9fa88..db1f077c 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -1,7 +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))