Quantcast
Channel: review/cwtags Changelog
Viewing all articles
Browse latest Browse all 75

Fix tests on Python 3.6+

$
0
0
changeset 8826210d8de0
branch
bookmark
tag
user Jérémy Bobbio <jeremy.bobbio@irq7.fr>
description Fix tests on Python 3.6+

Python 3.6 (and subsequent releases) implements PEP 468
(“Preserving the order of **kwargs in a function”).
For more details, see:
https://docs.python.org/3.6/whatsnew/3.6.html#new-dict-implementation
https://www.python.org/dev/peps/pep-0468/

This means that when a tag is converted to a string,
the order of the attributes will always match the order
of attributes passed to build the tag.

In order to make TestTagsTC.test_flag_tags pass on
Python 3.6+, we thus need to make the order of the
attributes in the reference string consistent with
the order of the tag keyword arguments.

We change the order of the arguments and not the order
of the attributes in the string to match the order of
the cwtags.tagbuilder documentation.

Unfortunately, the new argument order makes Python 2.7
sort the keyword argument dictionary differently. We
adjust the PYTHONHASHSEED environment variable to use
a randomizing seed that will match the Python 3.6+ order.
files test/unittest_tags.py
tox.ini

Viewing all articles
Browse latest Browse all 75

Latest Images

Trending Articles



Latest Images