| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7d4d1ec commit 10a14d1
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -204,16 +204,8 @@ def f3() -> None: | |||
| 204 | 204 | def f4() -> None: | |
| 205 | 205 | assert sys == 42 # type: ignore[comparison-overlap] | |
| 206 | 206 | ||
| 207 | - verbose = request.config.getoption("verbose") | ||
| 208 | 207 | msg = getmsg(f4, {"sys": sys}) | |
| 209 | - if verbose > 0: | ||
| 210 | - assert msg == ( | ||
| 211 | - "assert <module 'sys' (built-in)> == 42\n" | ||
| 212 | - " +<module 'sys' (built-in)>\n" | ||
| 213 | - " -42" | ||
| 214 | - ) | ||
| 215 | - else: | ||
| 216 | - assert msg == "assert sys == 42" | ||
| 208 | + assert msg == "assert sys == 42" | ||
| 217 | 209 | ||
| 218 | 210 | def f5() -> None: | |
| 219 | 211 | assert cls == 42 # type: ignore[name-defined] # noqa: F821 | |
@@ -224,20 +216,7 @@ class X: | |||
| 224 | 216 | msg = getmsg(f5, {"cls": X}) | |
| 225 | 217 | assert msg is not None | |
| 226 | 218 | lines = msg.splitlines() | |
| 227 | - if verbose > 1: | ||
| 228 | - assert lines == [ | ||
| 229 | - f"assert {X!r} == 42", | ||
| 230 | - f" +{X!r}", | ||
| 231 | - " -42", | ||
| 232 | - ] | ||
| 233 | - elif verbose > 0: | ||
| 234 | - assert lines == [ | ||
| 235 | - "assert <class 'test_...e.<locals>.X'> == 42", | ||
| 236 | - f" +{X!r}", | ||
| 237 | - " -42", | ||
| 238 | - ] | ||
| 239 | - else: | ||
| 240 | - assert lines == ["assert cls == 42"] | ||
| 219 | + assert lines == ["assert cls == 42"] | ||
| 241 | 220 | ||
| 242 | 221 | def test_assertrepr_compare_same_width(self, request) -> None: | |
| 243 | 222 | """Should use same width/truncation with same initial width.""" | |
@@ -279,14 +258,11 @@ def f() -> None: | |||
| 279 | 258 | msg = getmsg(f, {"cls": Y}) | |
| 280 | 259 | assert msg is not None | |
| 281 | 260 | lines = msg.splitlines() | |
| 282 | - if request.config.getoption("verbose") > 0: | ||
| 283 | - assert lines == ["assert 3 == 2", " +3", " -2"] | ||
| 284 | - else: | ||
| 285 | - assert lines == [ | ||
| 286 | - "assert 3 == 2", | ||
| 287 | - " + where 3 = Y.foo", | ||
| 288 | - " + where Y = cls()", | ||
| 289 | - ] | ||
| 261 | + assert lines == [ | ||
| 262 | + "assert 3 == 2", | ||
| 263 | + " + where 3 = Y.foo", | ||
| 264 | + " + where Y = cls()", | ||
| 265 | + ] | ||
| 290 | 266 | ||
| 291 | 267 | def test_assert_already_has_message(self) -> None: | |
| 292 | 268 | def f(): | |
@@ -663,10 +639,7 @@ def f(): | |||
| 663 | 639 | assert len(values) == 11 | |
| 664 | 640 | ||
| 665 | 641 | msg = getmsg(f) | |
| 666 | - if request.config.getoption("verbose") > 0: | ||
| 667 | - assert msg == "assert 10 == 11\n +10\n -11" | ||
| 668 | - else: | ||
| 669 | - assert msg == "assert 10 == 11\n + where 10 = len([0, 1, 2, 3, 4, 5, ...])" | ||
| 642 | + assert msg == "assert 10 == 11\n + where 10 = len([0, 1, 2, 3, 4, 5, ...])" | ||
| 670 | 643 | ||
| 671 | 644 | def test_custom_reprcompare(self, monkeypatch) -> None: | |
| 672 | 645 | def my_reprcompare1(op, left, right) -> str: | |
@@ -732,10 +705,7 @@ def __repr__(self): | |||
| 732 | 705 | msg = getmsg(f) | |
| 733 | 706 | assert msg is not None | |
| 734 | 707 | lines = util._format_lines([msg]) | |
| 735 | - if request.config.getoption("verbose") > 0: | ||
| 736 | - assert lines == ["assert 0 == 1\n +0\n -1"] | ||
| 737 | - else: | ||
| 738 | - assert lines == ["assert 0 == 1\n + where 1 = \\n{ \\n~ \\n}.a"] | ||
| 708 | + assert lines == ["assert 0 == 1\n + where 1 = \\n{ \\n~ \\n}.a"] | ||
| 739 | 709 | ||
| 740 | 710 | def test_custom_repr_non_ascii(self) -> None: | |
| 741 | 711 | def f() -> None: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments