From 7008fd44f545f0794030dc73d9e1d3115ec9e88d Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 10 Jan 2020 09:09:50 +0100 Subject: [PATCH] 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 ``` --- test/test_coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_coordinator.py b/test/test_coordinator.py index 88ca4c1fc..ea8f84bb6 100644 --- a/test/test_coordinator.py +++ b/test/test_coordinator.py @@ -55,7 +55,7 @@ def test_autocommit_enable_api_version(client, api_version): def test_protocol_type(coordinator): - assert coordinator.protocol_type() is 'consumer' + assert coordinator.protocol_type() == 'consumer' def test_group_protocols(coordinator):