Mark tests needing TOML-writing library with a custom marker
This way they can be conveniently skipped with `pytest -m "not tomlwrite"` in environments where such libraries aren't available.
This commit is contained in:
parent
516301c02b
commit
7390f91592
4 changed files with 8 additions and 0 deletions
|
|
@ -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"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue