nvchecker/tests/test_gitea.py
lilydjwg 471b66ff4c tests: use pytest-rerunfailures instead of flaky
flaky is no longer compatible with pytest 8.0 and seems unmaintained.

https://github.com/pytest-dev/pytest/issues/12066
2024-03-09 20:23:25 +08:00

23 lines
669 B
Python

# MIT licensed
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
import pytest
pytestmark = [pytest.mark.asyncio(scope="session"),
pytest.mark.needs_net]
@pytest.mark.flaky(reruns=10)
async def test_gitea(get_version):
ver = await get_version("example", {
"source": "gitea",
"gitea": "gitea/tea"})
assert len(ver) == 8
assert ver.isdigit()
@pytest.mark.flaky(reruns=10)
async def test_gitea_max_tag_with_include(get_version):
assert await get_version("example", {
"source": "gitea",
"gitea": "gitea/tea",
"use_max_tag": True,
"include_regex": r'v0\.3.*',
}) == "v0.3.1"