Skip to content

Commit 75c9fba

Browse files
committed
Use is to test tri-state, rather than equality
See #1346 (comment)
1 parent d389c91 commit 75c9fba

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/test_binding_inheritance.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def test_just_app_no_bindings() -> None:
4040
"""An app with no bindings should have no bindings, other than ctrl+c."""
4141
async with NoBindings().run_test() as pilot:
4242
assert list(pilot.app._bindings.keys.keys()) == ["ctrl+c"]
43-
assert pilot.app._bindings.get_key("ctrl+c").priority == True
43+
assert pilot.app._bindings.get_key("ctrl+c").priority is True
4444

4545

4646
##############################################################################
@@ -62,8 +62,8 @@ async def test_just_app_alpha_binding() -> None:
6262
"""An app with a single binding should have just the one binding."""
6363
async with AlphaBinding().run_test() as pilot:
6464
assert sorted(pilot.app._bindings.keys.keys()) == sorted(["ctrl+c", "a"])
65-
assert pilot.app._bindings.get_key("ctrl+c").priority == True
66-
assert pilot.app._bindings.get_key("a").priority == True
65+
assert pilot.app._bindings.get_key("ctrl+c").priority is True
66+
assert pilot.app._bindings.get_key("a").priority is True
6767

6868

6969
##############################################################################
@@ -85,8 +85,8 @@ async def test_just_app_low_priority_alpha_binding() -> None:
8585
"""An app with a single low-priority binding should have just the one binding."""
8686
async with LowAlphaBinding().run_test() as pilot:
8787
assert sorted(pilot.app._bindings.keys.keys()) == sorted(["ctrl+c", "a"])
88-
assert pilot.app._bindings.get_key("ctrl+c").priority == True
89-
assert pilot.app._bindings.get_key("a").priority == False
88+
assert pilot.app._bindings.get_key("ctrl+c").priority is True
89+
assert pilot.app._bindings.get_key("a").priority is False
9090

9191

9292
##############################################################################
@@ -119,12 +119,12 @@ async def test_app_screen_with_bindings() -> None:
119119
# inherits from Widget. That's fine. Let's check they're there, but
120120
# also let's check that they all have a non-priority binding.
121121
assert all(
122-
pilot.app.screen._bindings.get_key(key).priority == False
122+
pilot.app.screen._bindings.get_key(key).priority is False
123123
for key in MOVEMENT_KEYS
124124
)
125125
# Let's also check that the 'a' key is there, and it *is* a priority
126126
# binding.
127-
assert pilot.app.screen._bindings.get_key("a").priority == True
127+
assert pilot.app.screen._bindings.get_key("a").priority is True
128128

129129

130130
##############################################################################
@@ -158,7 +158,7 @@ async def test_app_screen_with_low_bindings() -> None:
158158
# too, so let's ensure they're all in there, along with our own key,
159159
# and that everyone is low-priority.
160160
assert all(
161-
pilot.app.screen._bindings.get_key(key).priority == False
161+
pilot.app.screen._bindings.get_key(key).priority is False
162162
for key in ["a", *MOVEMENT_KEYS]
163163
)
164164

0 commit comments

Comments
 (0)