Skip to content

Commit 4057e00

Browse files
committed
Update test_build_docs_versions::test_from_json... with new behavior
1 parent b4136b6 commit 4057e00

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/test_build_docs_versions.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
import logging
4+
35
import pytest
46

57
from build_docs import Version, Versions
@@ -57,17 +59,17 @@ def test_from_json() -> None:
5759
]
5860

5961

60-
def test_from_json_error() -> None:
62+
def test_from_json_warning(caplog) -> None:
6163
# Arrange
6264
json_data = {"2.8": {"branch": "2.8", "pep": 404, "status": "ex-release"}}
6365

64-
# Act / Assert
65-
with pytest.raises(
66-
ValueError,
67-
match="Saw invalid version status 'ex-release', expected to be one of",
68-
):
66+
# Act
67+
with caplog.at_level(logging.WARNING):
6968
Versions.from_json(json_data)
7069

70+
# Assert
71+
assert "Saw invalid version status 'ex-release', expected to be one of" in caplog.text
72+
7173

7274
def test_current_stable(versions) -> None:
7375
# Act

0 commit comments

Comments
 (0)