diff options
author | Christian Clauss <cclauss@me.com> | 2020-01-10 09:09:50 +0100 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2020-02-05 15:25:13 -0800 |
commit | 7008fd44f545f0794030dc73d9e1d3115ec9e88d (patch) | |
tree | 234795b75e86c39b2450374534f1f995e6ab9cf1 /test/test_coordinator.py | |
parent | 385f60316eef4f16922c56a4b0f1a0e0891530d2 (diff) | |
download | kafka-python-7008fd44f545f0794030dc73d9e1d3115ec9e88d.tar.gz |
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
```
Diffstat (limited to 'test/test_coordinator.py')
-rw-r--r-- | test/test_coordinator.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test_coordinator.py b/test/test_coordinator.py index 88ca4c1..ea8f84b 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): |