New submission from Eric V. Smith:

Now that **kwargs are sorted, it would be better if the error given by a 
unittest subTest (as implemented in uniitest._case._SubTest) didn't sort the 
parameters when they're printed, but instead printed them out in order.

This might be complicated by the ChainMap that's used as part of the 
implementation, but it should still be doable.

For example, I have code that has:

    with self.subTest(hash=hash, cmp=cmp, frozen=frozen):

But when it errors out, it produces:

    FAIL: test_hash_rules (tst.TestCase) (cmp=True, frozen=True, hash=None)

It would be easier to check my code if the order the values was printed was the 
same as the order in the self.subTest() call.

----------
components: Library (Lib)
keywords: easy
messages: 295998
nosy: eric.smith
priority: normal
severity: normal
status: open
title: Change unittest's _SubTest to not sort its params
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30664>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to