Allow non-string keys when rewriting assertDictContainsSubset
and also update supported Python versions in tox.ini.
#54
I guess {**a, **b} is not supported on Python 2. One tricky thing is that dict(a, **b) actually works in Python 2. We will have to either drop Python 2 support or have a flag like --py2 (and --py3?) to enable that. While we're doing this, we might as well add a --py39 because on 3.9 you can do a | a == a.
Thanks @verhovsky!
My 2 cents:
I think dropping Python 2 is fine, and then we always use the Python 3 syntax ({**a, **b}).
If not, not sure we need a flag, we might just use the version of the Python we are running (sys.version_info).
use the version of the Python we are running
If someone doesn't realize their pip command is Python 2 pip and does pip install unittest2pytest, they will run into this bug when they run unittest2pytest <whatever>. In a way dropping Python 2 support has the same effect, since installing unittest2pytest under Python 2 will install the last version, which is the one that rewrites it as dict(b, **a).
I also dropped Python 3.5 which is unsupported since 2020-09, I hope that's fine.
LGTM!
This also warrants a changelog entry. 👍