Skip to content

Commit 9cbf45d

Browse files
committed
appease ruff v0.0.263
1 parent 7d92147 commit 9cbf45d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tests/test_class_sh_property.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_uqp(m_attr_readwrite, msg):
9292
field_orig.num = 39
9393
setattr(outer, m_attr_readwrite, field_orig)
9494
with pytest.raises(ValueError) as excinfo:
95-
field_orig.num
95+
_ = field_orig.num
9696
assert (
9797
msg(excinfo.value)
9898
== "Missing value for wrapped C++ type: Python instance was disowned."
@@ -103,7 +103,7 @@ def test_uqp(m_attr_readwrite, msg):
103103
field_retr1.num = 93
104104
setattr(outer, m_attr_readwrite, field_retr1)
105105
with pytest.raises(ValueError):
106-
field_retr1.num
106+
_ = field_retr1.num
107107
field_retr2 = getattr(outer, m_attr_readwrite)
108108
assert field_retr2.num == 93
109109

@@ -150,7 +150,7 @@ def test_unique_ptr_field_proxy_poc(m_attr):
150150
assert field_proxy.num == 45
151151
assert field_proxy.num == 45
152152
with pytest.raises(AttributeError):
153-
field_proxy.xyz
153+
_ = field_proxy.xyz
154154
assert field_proxy.num == 45
155155
field_proxy.num = 82
156156
assert field_proxy.num == 82

tests/test_class_sh_trampoline_self_life_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_m_big5():
1414
assert o1 is not obj
1515
assert o1.history == "Seed"
1616
with pytest.raises(ValueError) as excinfo:
17-
obj.history
17+
_ = obj.history
1818
assert "Python instance was disowned" in str(excinfo.value)
1919
assert o2 is None
2020

tests/test_class_sh_trampoline_shared_from_this.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_release_and_shared_from_this_leak():
2929
obj = PySft("")
3030
while True:
3131
m.pass_shared_ptr(obj)
32-
assert obj.history == ""
32+
assert not obj.history
3333
assert m.use_count(obj) == 1
3434
break # Comment out for manual leak checking (use `top` command).
3535

@@ -82,11 +82,11 @@ def test_release_and_stash_leak():
8282
while True:
8383
stash1 = m.SftSharedPtrStash(1)
8484
stash1.Add(obj)
85-
assert obj.history == ""
85+
assert not obj.history
8686
assert m.use_count(obj) == 2
8787
assert stash1.use_count(0) == 1
8888
stash1.Add(obj)
89-
assert obj.history == ""
89+
assert not obj.history
9090
assert m.use_count(obj) == 3
9191
assert stash1.use_count(0) == 2
9292
assert stash1.use_count(1) == 2
@@ -117,10 +117,10 @@ def test_release_and_stash_via_shared_from_this_leak():
117117
stash1.AddSharedFromThis(obj)
118118
assert str(exc_info.value) == "bad_weak_ptr"
119119
stash1.Add(obj)
120-
assert obj.history == ""
120+
assert not obj.history
121121
assert stash1.use_count(0) == 1
122122
stash1.AddSharedFromThis(obj)
123-
assert obj.history == ""
123+
assert not obj.history
124124
assert stash1.use_count(0) == 2
125125
assert stash1.use_count(1) == 2
126126
break # Comment out for manual leak checking (use `top` command).
@@ -186,7 +186,7 @@ def test_multiple_registered_instances_for_same_pointee_leak():
186186
stash1.Add(m.Sft(obj0))
187187
assert stash1.use_count(0) == 1
188188
assert stash1.use_count(1) == 1
189-
assert obj0.history == ""
189+
assert not obj0.history
190190
break # Comment out for manual leak checking (use `top` command).
191191

192192

0 commit comments

Comments
 (0)