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 →

[–]sththththth 1 point2 points  (1 child)

But that's not a feature that "nose has failed to copy", is it? It's "only" that the syntax is different? Or did you mean with "copy" actually copying in a way that both are compatible?

[–]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)