File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ dependencies = [
4444]
4545optional-dependencies.dev = [
4646 " actionlint-py==1.7.7.23" ,
47+ " anstrip==0.2.2" ,
4748 " check-manifest==0.50" ,
4849 " deptry==0.23.1" ,
4950 " doc8==2.0.0" ,
Original file line number Diff line number Diff line change 1010from pathlib import Path
1111from typing import Any
1212
13+ import anstrip
1314import pytest
1415from beartype import beartype
1516from sphinx .testing .util import SphinxTestApp
@@ -99,8 +100,13 @@ def _assert_rst_converts_to_notion_objects(
99100 assert app .statuscode == 0
100101
101102 warning_output = app .warning .getvalue ()
102- for expected_warning in expected_warnings :
103- assert expected_warning in warning_output
103+ ansi_stripped_warning_output = anstrip .strip (string = warning_output )
104+ warnings = [
105+ item .strip ()
106+ for item in ansi_stripped_warning_output .split (sep = "WARNING: " )
107+ if item .strip ()
108+ ]
109+ assert list (expected_warnings ) == warnings
104110
105111 output_file = app .outdir / "index.json"
106112 with output_file .open (encoding = "utf-8" ) as f :
You can’t perform that action at this time.
0 commit comments