diff --git a/stages/test/test_bootc_install_config.py b/stages/test/test_bootc_install_config.py index c839f6f4..afedcf6e 100644 --- a/stages/test/test_bootc_install_config.py +++ b/stages/test/test_bootc_install_config.py @@ -73,6 +73,7 @@ STAGE_NAME = "org.osbuild.bootc.install.config" ) ] ) +@pytest.mark.tomlwrite def test_bootc_install_config(tmp_path, stage_module, options, expected_config): stage_module.main(tmp_path, options) # different toml libraries write out arrays in different ways (one line vs many), so we need to parse the result diff --git a/stages/test/test_containers_storage_conf.py b/stages/test/test_containers_storage_conf.py index d98409e6..d8c315cc 100644 --- a/stages/test/test_containers_storage_conf.py +++ b/stages/test/test_containers_storage_conf.py @@ -18,6 +18,7 @@ TEST_INPUT = [ STAGE_NAME = "org.osbuild.containers.storage.conf" +@pytest.mark.tomlwrite @pytest.mark.parametrize("test_filename", ["/etc/containers/storage.conf", "/usr/share/containers/storage.conf"]) @pytest.mark.parametrize("test_storage,test_options,expected", TEST_INPUT) def test_containers_storage_conf_integration(tmp_path, stage_module, test_filename, test_storage, test_options, expected): # pylint: disable=unused-argument diff --git a/test/conftest.py b/test/conftest.py index f2ff9f3f..b748e847 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -17,3 +17,6 @@ def pytest_configure(config): # pylint: disable=global-statement global unsupported_filesystems unsupported_filesystems = config.getoption("--unsupported-fs") + config.addinivalue_line( + "markers", "tomlwrite: mark test to run only in an environment with a TOML-writing library available" + ) diff --git a/test/mod/test_util_toml.py b/test/mod/test_util_toml.py index 9bcb022f..3cfe1f0d 100644 --- a/test/mod/test_util_toml.py +++ b/test/mod/test_util_toml.py @@ -4,6 +4,8 @@ import os from tempfile import TemporaryDirectory +import pytest + from osbuild.util import toml data_obj = { @@ -26,6 +28,7 @@ str = "test" """ +@pytest.mark.tomlwrite def test_write_read(): with TemporaryDirectory() as tmpdir: path = os.path.join(tmpdir, "test.toml")