Skip to content

Commit 7008fd4

Browse files
cclaussjeffwidman
authored andcommitted
Use ==/!= to compare str, bytes, and int literals
Identity is not the same thing as equality in Python so use ==/!= to compare str, bytes, and int literals. In Python >= 3.8, these instances will raise __SyntaxWarnings__ so it is best to fix them now. https://docs.python.org/3.8/whatsnew/3.8.html#porting-to-python-3-8 % __python__ ``` >>> consumer = "cons" >>> consumer += "umer" >>> consumer == "consumer" True >>> consumer is "consumer" False >>> 0 == 0.0 True >>> 0 is 0.0 False ```
1 parent 385f603 commit 7008fd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_autocommit_enable_api_version(client, api_version):
5555

5656

5757
def test_protocol_type(coordinator):
58-
assert coordinator.protocol_type() is 'consumer'
58+
assert coordinator.protocol_type() == 'consumer'
5959

6060

6161
def test_group_protocols(coordinator):

0 commit comments

Comments
 (0)