Fix: tests: conditionally skip Python bindings test that requires Python plugins...
[babeltrace.git] / tests / bindings / python / bt2 / test_trace_collection_message_iterator.py
index 954b149c33645fc47c625b60a7681f1c130f08b1..53d838fc7a99a4783837094c9861208cd7de4d77 100644 (file)
@@ -3,12 +3,12 @@
 # Copyright (C) 2019 EfficiOS Inc.
 #
 
-import unittest
-import datetime
-import bt2
 import os
 import os.path
+import datetime
+import unittest
 
+import bt2
 
 _BT_TESTS_DATADIR = os.environ["BT_TESTS_DATADIR"]
 _BT_CTF_TRACES_PATH = os.environ["BT_CTF_TRACES_PATH"]
@@ -29,6 +29,7 @@ _AUTO_SOURCE_DISCOVERY_PARAMS_LOG_LEVEL_PATH = os.path.join(
 _METADATA_SYNTAX_ERROR_TRACE_PATH = os.path.join(
     _BT_CTF_TRACES_PATH, "fail", "metadata-syntax-error"
 )
+_BT_ENABLE_PYTHON_PLUGINS = os.environ["BT_TESTS_ENABLE_PYTHON_PLUGINS"] == "1"
 
 
 class _SomeSource(
@@ -407,6 +408,10 @@ class _TestAutoDiscoverSourceComponentSpecs(unittest.TestCase):
         os.environ["BABELTRACE_PLUGIN_PATH"] = self._saved_babeltrace_plugin_path
 
 
+@unittest.skipUnless(
+    _BT_ENABLE_PYTHON_PLUGINS,
+    "Support for Python plugins is disabled",
+)
 class TestAutoDiscoverSourceComponentSpecsGrouping(
     _TestAutoDiscoverSourceComponentSpecs
 ):
@@ -432,6 +437,10 @@ class TestAutoDiscoverSourceComponentSpecsGrouping(
         self.assertEqual(msgs[7].stream.name, "TestSourceSomeDir: some-dir")
 
 
+@unittest.skipUnless(
+    _BT_ENABLE_PYTHON_PLUGINS,
+    "Support for Python plugins is disabled",
+)
 class TestAutoDiscoverSourceComponentSpecsParamsObjLogLevel(
     _TestAutoDiscoverSourceComponentSpecs
 ):
This page took 0.025827 seconds and 4 git commands to generate.