[#302] Autoadd marks for frostfs #302
3 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
__version__ = "2.0.1"
|
__version__ = "2.0.1"
|
||||||
|
|
||||||
from .fixtures import configure_testlib, hosting, temp_directory
|
from .fixtures import configure_testlib, hosting, temp_directory
|
||||||
|
from .hooks import pytest_collection_modifyitems
|
||||||
|
|
12
src/frostfs_testlib/hooks.py
Normal file
12
src/frostfs_testlib/hooks.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.hookimpl
|
||||||
|
def pytest_collection_modifyitems(items: list[pytest.Item]):
|
||||||
|
# All tests which reside in frostfs nodeid are granted with frostfs marker, excluding
|
||||||
|
# nodeid = full path of the test
|
||||||
|
# 1. plugins
|
||||||
|
# 2. testlib itself
|
||||||
|
for item in items:
|
||||||
|
if "frostfs" in item.nodeid and "plugin" not in item.nodeid and "testlib" not in item.nodeid:
|
||||||
|
item.add_marker("frostfs")
|
|
@ -8,6 +8,7 @@ ONLY_ASCII_LETTERS = string.ascii_letters
|
||||||
DIGITS_AND_ASCII_LETTERS = string.ascii_letters + string.digits
|
DIGITS_AND_ASCII_LETTERS = string.ascii_letters + string.digits
|
||||||
NON_DIGITS_AND_LETTERS = string.punctuation
|
NON_DIGITS_AND_LETTERS = string.punctuation
|
||||||
|
|
||||||
|
# if unique_name is called multiple times within the same microsecond, append 0-4 to the name so it surely unique
|
||||||
FUSE = itertools.cycle(range(5))
|
FUSE = itertools.cycle(range(5))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue