Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)

<!-- PyPI badges (uncomment once package is published)
[![PyPI version](https://img.shields.io/pypi/v/openadapt-telemetry.svg)](https://pypi.org/project/openadapt-telemetry/)
[![Downloads](https://img.shields.io/pypi/dm/openadapt-telemetry.svg)](https://pypi.org/project/openadapt-telemetry/)
-->

Unified telemetry and error tracking for OpenAdapt packages.

Expand Down
24 changes: 24 additions & 0 deletions tests/test_readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Checks that the README matches the published state of the package."""

import re
from pathlib import Path

README = Path(__file__).resolve().parent.parent / "README.md"
HTML_COMMENT = re.compile(r"<!--.*?-->", re.DOTALL)


def _visible_readme() -> str:
"""Return the README text with HTML comments removed."""
return HTML_COMMENT.sub("", README.read_text(encoding="utf-8"))


def test_readme_does_not_say_package_is_unpublished():
"""The package is on PyPI, so no note may say it isn't yet."""
assert "uncomment once package is published" not in README.read_text(encoding="utf-8")


def test_readme_shows_pypi_badges():
"""The PyPI version and downloads badges render (are not inside a comment)."""
visible = _visible_readme()
assert "img.shields.io/pypi/v/openadapt-telemetry" in visible
assert "img.shields.io/pypi/dm/openadapt-telemetry" in visible
Loading