Skip to content

Commit 02ce718

Browse files
committed
Trasnfer code from fmf_metadata directly to FMF
1 parent b09ae2f commit 02ce718

File tree

10 files changed

+604
-115
lines changed

10 files changed

+604
-115
lines changed

fmf/plugin_loader.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@ def enabled_plugins():
3434
plugins = os.getenv(PLUGIN_ENV).split(",") if os.getenv(PLUGIN_ENV) else []
3535
plugin_list = list()
3636
for item in plugins:
37-
loader = importlib.machinery.SourceFileLoader(
38-
os.path.basename(item), item)
39-
module = importlib.util.module_from_spec(
40-
importlib.util.spec_from_loader(loader.name, loader)
41-
)
42-
loader.exec_module(module)
37+
if os.path.exists(item):
38+
loader = importlib.machinery.SourceFileLoader(
39+
os.path.basename(item), item)
40+
module = importlib.util.module_from_spec(
41+
importlib.util.spec_from_loader(loader.name, loader)
42+
)
43+
loader.exec_module(module)
44+
else:
45+
module = importlib.import_module(item)
4346
for name, plugin in inspect.getmembers(module):
4447
if inspect.isclass(plugin) and plugin != Plugin and issubclass(
4548
plugin, Plugin):

fmf/plugins/__init__.py

Whitespace-only changes.

fmf/plugins/pytest.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

fmf/plugins/pytest/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from fmf.plugins.pytest.tmt_semantic import TMT
2+
from fmf.plugins.pytest.plugin import Pytest

fmf/plugins/pytest/constants.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CONFIG_POSTPROCESSING_TEST = "test_postprocessing"
2+
PYTEST_DEFAULT_CONF = {
3+
CONFIG_POSTPROCESSING_TEST: {
4+
"test": """
5+
cls_str = ("::" + str(cls.name)) if cls.name else ""
6+
escaped = shlex.quote(f"{filename}{cls_str}::{test.name}")
7+
f"python3 -m pytest -m '' -v {escaped}" """
8+
}
9+
}
10+
CONFIG_MERGE_PLUS = "merge_plus"
11+
CONFIG_MERGE_MINUS = "merge_minus"
12+
CONFIG_ADDITIONAL_KEY = "additional_keys"
13+
CONFIG_POSTPROCESSING_TEST = "test_postprocessing"

0 commit comments

Comments
 (0)