[issue35281] Allow access to unittest.TestSuite tests

Lihu report at bugs.python.org
Fri Nov 23 14:58:22 EST 2018


Lihu <lihu at starry.com> added the comment:

Sorry, I guess some context might be helpful. I'm writing a program that links unittest-based tests with a third-party test tracking/reporting system. Said third-party software has a concept of test suites/cases that doesn't align 1:1 with unittest, so I need to manipulate the unittest objects a bit to get them to connect smoothly.

`list(test_suite)` is a bit clunky for me, since I'm already copying said list in order to do my manipulation. So I end up with expressions like:

```
my_cases = list(my_custom_generator(list(test_suite)))
```

Certainly not the end of the world, and it works just fine, but it's redundant and I need to do it a lot. I realize that `list(iterator)` is an increasingly common idiom in python 3, but I thought I'd throw this usecase out there for your consideration.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35281>
_______________________________________


More information about the Python-bugs-list mailing list