summaryrefslogtreecommitdiff
path: root/net-mgmt/py-pysmi/files/tests__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/py-pysmi/files/tests__init__.py')
-rw-r--r--net-mgmt/py-pysmi/files/tests__init__.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/net-mgmt/py-pysmi/files/tests__init__.py b/net-mgmt/py-pysmi/files/tests__init__.py
new file mode 100644
index 000000000000..b6f4cc125c2a
--- /dev/null
+++ b/net-mgmt/py-pysmi/files/tests__init__.py
@@ -0,0 +1,20 @@
+from unittest import SkipTest, TestSuite
+
+
+def load_tests(loader, tests, pattern):
+ import suite
+ return suite.suite
+
+
+try:
+ from pysnmp.smi.builder import MibBuilder
+except ImportError:
+
+ # python -m unittest pysmi.tests
+ def load_tests(*args, **kwars):
+ print("Skipping test suite: pysnmp is not installed")
+ return TestSuite()
+
+ # nosetests pysmi
+ def setup():
+ raise SkipTest("pysnmp is not installed")