| 1193 | |
| 1194 | |
| 1195 | def test_raisesexc_tostring() -> None: |
| 1196 | assert str(RaisesExc(ValueError)) == "RaisesExc(ValueError)" |
| 1197 | assert str(RaisesExc(match="[a-z]")) == "RaisesExc(match='[a-z]')" |
| 1198 | pattern_no_flags = re.compile(r"noflag", 0) |
| 1199 | assert str(RaisesExc(match=pattern_no_flags)) == "RaisesExc(match='noflag')" |
| 1200 | pattern_flags = re.compile(r"noflag", re.IGNORECASE) |
| 1201 | assert str(RaisesExc(match=pattern_flags)) == f"RaisesExc(match={pattern_flags!r})" |
| 1202 | assert ( |
| 1203 | str(RaisesExc(ValueError, match="re", check=bool)) |
| 1204 | == f"RaisesExc(ValueError, match='re', check={bool!r})" |
| 1205 | ) |
| 1206 | |
| 1207 | |
| 1208 | def test_raisesgroup_tostring() -> None: |