File: Fixes-ypeError_Population_must_be_a_sequence.patch

package info (click to toggle)
python-kafka 2.0.2-10
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,740 kB
  • sloc: python: 20,457; makefile: 210; sh: 76
file content (20 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Author: Hirotaka Wakabayashi <hiwkby@yahoo.com>
Date: Mon, 27 Jun 2022 14:54:17 +0900
Description: Fixes "TypeError: Population must be a sequence." using random.sample()
Bug-Debian: https://bugs.debian.org/1026497
Origin: upstream, https://github.com/dpkp/kafka-python/commit/779ce3a0b11487ad13f89df8ba5928bdff7c808d.patch
Last-Update: 2022-01-13

diff --git a/test/test_assignors.py b/test/test_assignors.py
index 67e91e131..89a0e3133 100644
--- a/test/test_assignors.py
+++ b/test/test_assignors.py
@@ -655,7 +655,7 @@ def test_conflicting_previous_assignments(mocker):
     'execution_number,n_topics,n_consumers', [(i, randint(10, 20), randint(20, 40)) for i in range(100)]
 )
 def test_reassignment_with_random_subscriptions_and_changes(mocker, execution_number, n_topics, n_consumers):
-    all_topics = set(['t{}'.format(i) for i in range(1, n_topics + 1)])
+    all_topics = sorted(set(['t{}'.format(i) for i in range(1, n_topics + 1)]))
     partitions = dict([(t, set(range(1, i + 1))) for i, t in enumerate(all_topics)])
     cluster = create_cluster(mocker, topics=all_topics, topic_partitions_lambda=lambda t: partitions[t])