From 8de2c035e2ef2ac3348e2ba9da2c957dbd8ede50 Mon Sep 17 00:00:00 2001 From: LeeKamentsky Date: Wed, 4 Nov 2015 13:52:40 -0500 Subject: [PATCH] Fixes #1169 The unittest.skip decorator runs @functools.wraps on self._testcase. functools.wraps expects a "__name__" attribute and this patch adds one. It might not be the correct fix, but it works for me. --- _pytest/unittest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/_pytest/unittest.py b/_pytest/unittest.py index 3b08c9f90..6c3a72697 100644 --- a/_pytest/unittest.py +++ b/_pytest/unittest.py @@ -134,6 +134,7 @@ class TestCaseFunction(pytest.Function): pass def runtest(self): + setattr(self._testcase, "__name__", self.name) self._testcase(result=self) def _prunetraceback(self, excinfo):