Skip to content

Commit

Permalink
Update test for doc split.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Sep 23, 2024
1 parent d9b03ad commit ec4d39d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion ops/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"""

# ruff: noqa: F401 (unused import)
# pyright: reportUnusedImport=false

import importlib.metadata

Expand Down Expand Up @@ -196,4 +197,4 @@
'pebble',
'storage',
]
__all__.extend(_compatibility_names)
__all__.extend(_compatibility_names) # type: ignore[reportUnsupportedDunderAll]
15 changes: 9 additions & 6 deletions test/test_infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pathlib
import subprocess
import sys
import typing

import pytest

Expand Down Expand Up @@ -74,11 +75,13 @@ def test_ops_testing_doc():
# even though the above compatibility_names logic would exclude it.
expected_names.add('Container')

with open('docs/index.rst') as testing_doc:
found_names = {
line.split(prefix, 1)[1].strip()
for line in testing_doc
if line.strip().startswith(prefix)
}
found_names: typing.Set[str] = set()
for test_doc in ('docs/harness.rst', 'docs/state-transition-testing.rst'):
with open(test_doc) as testing_doc:
found_names.update({
line.split(prefix, 1)[1].strip()
for line in testing_doc
if line.strip().startswith(prefix)
})

assert expected_names == found_names

0 comments on commit ec4d39d

Please sign in to comment.