summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Levin <31205609+stanislavlevin@users.noreply.github.com>2019-02-21 12:04:59 +0300
committerTaras Voinarovskyi <voyn1991@gmail.com>2019-02-21 11:04:59 +0200
commit03664ebe9ed8bc965391f925d50219eea4d6ac57 (patch)
tree42e0e2d94a7b9d42da250133434b7a31fe546d2a
parenteed59ba3b3c8800859572db046f36b5d8bd66487 (diff)
downloadkafka-python-03664ebe9ed8bc965391f925d50219eea4d6ac57.tar.gz
Fix test_legacy_correct_metadata_response on x86 arch (#1718)
The problem is that the type of required operation result is "long". ``` >>> type(278251978 & 0xffffffff) <type 'long'> ``` However, by default "format" method uses __format__(): ``` >>> (278251978 & 0xffffffff).__format__('') '278251978' ``` So, let's compare things using the same engine: ``` >>> "{!r}".format(278251978 & 0xffffffff) '278251978L' ``` Fixes: https://github.com/dpkp/kafka-python/issues/1717 Signed-off-by: Stanislav Levin <slev@altlinux.org>
-rw-r--r--test/record/test_legacy_records.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/record/test_legacy_records.py b/test/record/test_legacy_records.py
index 23b8636..43970f7 100644
--- a/test/record/test_legacy_records.py
+++ b/test/record/test_legacy_records.py
@@ -141,7 +141,7 @@ def test_legacy_correct_metadata_response(magic):
assert meta.timestamp == (9999999 if magic else -1)
assert meta.crc == (-2095076219 if magic else 278251978) & 0xffffffff
assert repr(meta) == (
- "LegacyRecordMetadata(offset=0, crc={}, size={}, "
+ "LegacyRecordMetadata(offset=0, crc={!r}, size={}, "
"timestamp={})".format(meta.crc, meta.size, meta.timestamp)
)