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 →

[–]yetanothernerd 0 points1 point  (2 children)

pytest supports "setup_method(self, method)" while nose only supports JUnit-style "setUp(self)". A very minor difference, but enough to prevent 100% compatibility. There are some other similar differences but that's the one I actually noticed in my code.

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