[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 48fbe52ac71ea711a4701db909ad1ce2647b09fd by Serhiy Storchaka in branch 'master': bpo-30664: The description of a unittest subtest now preserves the (#2265) https://github.com/python/cpython/commit/48fbe52ac71ea711a4701db909ad1ce2647b09fd

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that the order of parameters of nested subtests is from inner to outer. -- ___ Python tracker ___

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +2316 ___ Python tracker ___ ___

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 2265 implements a private subclass of ChainMap that preserves ordering. -- nosy: +serhiy.storchaka ___ Python tracker

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-14 Thread Eric V. Smith
Eric V. Smith added the comment: Correct on the order changed with regular dicts. That's why I'm targeting this specifically for Python 3.7 and with **kwargs, where order is guaranteed. We might have to use a structure other than a ChainMap of dicts, like a ChainMap of OrderDicts. --

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-14 Thread Louie Lu
Louie Lu added the comment: Additional note, the order will changed it random way in ChainMap, e.g.: >>> for k, v in ChainMap({'a': 0, 'b': 1, 'c': 2}, {'b': 3, 'a': 4}).items(): >>> print(k, v) ... a 0 c 2 b 1 -restart >>> for k, v in ChainMap({'a': 0, 'b': 1, 'c': 2}, {'b': 3,

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-14 Thread Eric V. Smith
Eric V. Smith added the comment: Good question. It looks like ChainMap does something I wouldn't expect: >>> for k, v in ChainMap({'a': 0, 'b': 1, 'c': 2}, {'b': 3, 'a': 4}).items(): ... print(k, v) ... b 1 a 0 c 2 Once we define what we'd like the output to look like, I'm sure it would be

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-14 Thread Nitish
Changes by Nitish : -- nosy: +nitishch ___ Python tracker ___ ___

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-14 Thread Louie Lu
Louie Lu added the comment: I think the question will be, when using multiple subTest (this is why using ChainMap I think), how to determine their order?: with self.subTest(c=i, b=i, a=i): with self.subTest(b=i, c=50, a=60): self.assertEqual(i, 2) >>> FAIL: test_foo

[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-14 Thread Eric V. Smith
Eric V. Smith added the comment: Correction: it's implemented in unittest.case._SubTest, specifically in _subDescription(). -- title: Change unittest's _SubTest to not sort its params -> Change unittest's _SubTest to not sort its params when printing test failures