mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 00:14:41 +01:00
parent
354f446f54
commit
f3d314bc36
3 changed files with 15 additions and 3 deletions
|
@ -52,6 +52,9 @@ def qa(ns: argparse.Namespace):
|
|||
# todo: add xontrib folder here
|
||||
mypy xonsh --exclude xonsh/ply
|
||||
|
||||
echo "---------- Running news items check ----------"
|
||||
pytest -m news
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
|
@ -114,3 +114,5 @@ ignore_missing_imports = True
|
|||
|
||||
[tool:pytest]
|
||||
cache_dir = .cache/pytest
|
||||
markers =
|
||||
news: check changelog unit is valid rst
|
||||
|
|
|
@ -25,8 +25,8 @@ def check_news_file(fname):
|
|||
if "`" in l:
|
||||
if single_grave_reg.search(l):
|
||||
pytest.fail(
|
||||
"{}:{}: single grave accents"
|
||||
" are not valid rst".format(name, i + 1),
|
||||
"{}:{}: single grave accents (`)"
|
||||
" are not valid rst. Please use ``".format(name, i + 1),
|
||||
pytrace=True,
|
||||
)
|
||||
|
||||
|
@ -61,7 +61,14 @@ def check_news_file(fname):
|
|||
pytest.fail("{}: invalid rst".format(name), pytrace=True)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("fname", list(os.scandir(NEWSDIR)))
|
||||
@pytest.fixture(params=list(os.scandir(NEWSDIR)))
|
||||
def fname(request):
|
||||
if request.node.config.option.markexpr != "news":
|
||||
pytest.skip("Run news items check explicitly")
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.mark.news
|
||||
def test_news(fname):
|
||||
base, ext = os.path.splitext(fname.path)
|
||||
assert "rst" in ext
|
||||
|
|
Loading…
Add table
Reference in a new issue