chore: move news items check to qa (#4314)

fixes #4313
This commit is contained in:
Noorhteen Raja NJ 2021-06-11 17:31:35 +05:30 committed by GitHub
parent 354f446f54
commit f3d314bc36
Failed to generate hash of commit
3 changed files with 15 additions and 3 deletions

View file

@ -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()

View file

@ -114,3 +114,5 @@ ignore_missing_imports = True
[tool:pytest]
cache_dir = .cache/pytest
markers =
news: check changelog unit is valid rst

View file

@ -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