Skip to content

Commit

Permalink
Merge pull request #456 from acsone/do-not-fail-missing-readme-sbi
Browse files Browse the repository at this point in the history
gen-addons-table: do not fail if README.md is absent
  • Loading branch information
sbidoul authored May 30, 2020
2 parents c571700 + 821a188 commit 73c47b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/test_gen_addons_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ def test_1():
finally:
with open(readme_filename, 'w') as f:
f.write(readme_before)


def test_absent_readme(tmp_path):
"""gen_addons_table must not fail if README.md is absent"""
res = subprocess.call([
sys.executable, "-m", "tools.gen_addons_table"
], cwd=str(tmp_path))
assert res == 0
2 changes: 1 addition & 1 deletion tools/gen_addons_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def replace_in_readme(readme_path, header, rows_available, rows_unported):
@click.option('--commit/--no-commit',
help="git commit changes to README.rst, if any.")
@click.option('--readme-path', default="README.md",
type=click.Path(dir_okay=False, file_okay=True, exists=True),
type=click.Path(dir_okay=False, file_okay=True),
help="README.md file with addon table markers")
@click.option('--addons-dir', default=".",
type=click.Path(dir_okay=True, file_okay=False, exists=True),
Expand Down

0 comments on commit 73c47b6

Please sign in to comment.