Hi folks,
I have the unittest that may run over some sequence, failing occasionally on some elements.
So, instead of writing
Thanks in advance
I have the unittest that may run over some sequence, failing occasionally on some elements.
So, instead of writing
class MyTectClass(unittest.TestCase): ..... def TestOverSequence(self): for elem in sequence: <run a bunch of asserts>I would like to have something like
class MyTectClass(unittest.TestCase): def __init__(self): super().__init__() self.sequence_iter = iter(sequence) def TestOverElem(self): elem = next(self.sequence_iter) <run a bunch of asserts>Is it doable, and if it is - how?
Thanks in advance
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.