File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import logging
4+
35import pytest
46
57from 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
7274def test_current_stable (versions ) -> None :
7375 # Act
You can’t perform that action at this time.
0 commit comments