mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
typing and black
This commit is contained in:
parent
1f0491ed17
commit
da4737a999
3 changed files with 11 additions and 9 deletions
|
@ -186,7 +186,7 @@ def test_empty_repr():
|
|||
assert pretty_repr(Foo()) == ""
|
||||
|
||||
|
||||
def test_attrs():
|
||||
def test_attrs():
|
||||
@attr.define
|
||||
class Point:
|
||||
x: int
|
||||
|
@ -198,24 +198,26 @@ def test_attrs():
|
|||
expected = "Point(x=1, y=2, z=0)"
|
||||
assert result == expected
|
||||
|
||||
def test_attrs_empty():
|
||||
|
||||
def test_attrs_empty():
|
||||
@attr.define
|
||||
class Nada:
|
||||
pass
|
||||
|
||||
|
||||
result = pretty_repr(Nada())
|
||||
print(repr(result))
|
||||
expected = "Nada()"
|
||||
assert result == expected
|
||||
|
||||
def test_attrs_broken():
|
||||
|
||||
def test_attrs_broken():
|
||||
@attr.define
|
||||
class Foo:
|
||||
bar:int
|
||||
bar: int
|
||||
|
||||
foo = Foo(1)
|
||||
del foo.bar
|
||||
result = pretty_repr(foo)
|
||||
print(repr(result))
|
||||
expected = "Foo(bar=AttributeError('bar'))"
|
||||
assert result == expected
|
||||
assert result == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue