def test_readme(cookies):
"""The generated README.rst file should pass some sanity checks and validate as a PyPI long description."""
extra_context = {'repo_name': 'helloworld'}
with bake_in_temp_dir(cookies, extra_context=extra_context) as result:
readme_file = result.project.join('README.rst')
readme_lines = [x.strip() for x in readme_file.readlines(cr=False)]
assert 'helloworld' in readme_lines
assert 'The full documentation is at https://helloworld.readthedocs.org.' in readme_lines
setup_path = str(result.project.join('setup.py'))
try:
sh.python(setup_path, 'check', restructuredtext=True, strict=True)
except sh.ErrorReturnCode as exc:
pytest.fail(str(exc))
评论列表
文章目录