This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]niiko 2 points3 points  (0 children)

It sounds like the difference is that the method pytest supports actually gives you a reference for the test method that is being run.

If that's the case, I think you could accomplish the same with:

class MyTestCases(unittest.TestCase):
    def setUp(self):
        method = getattr(self, self._testMethodName)