Skip to content

Commit

Permalink
Fix tests on Python 3.11 (fix jonathaneunice#18)
Browse files Browse the repository at this point in the history
random.sample() population must be a sequence
  • Loading branch information
musicinmybrain committed Jun 20, 2022
1 parent 20e2e8c commit b7f0149
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_ansiwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

# as an alternative to testing all lengths at all times, which is slow,
# choose a few other lengths at random
other_lengths = (random.sample(set(range(20, 120)).difference(LINE_LENGTHS), 2) +
random.sample(set(range(120, 400)).difference(LINE_LENGTHS), 1))
other_lengths = (random.sample(sorted(set(range(20, 120)).difference(LINE_LENGTHS)), 2) +
random.sample(sorted(set(range(120, 400)).difference(LINE_LENGTHS)), 1))
LINE_LENGTHS.extend(other_lengths)


Expand Down

0 comments on commit b7f0149

Please sign in to comment.