summaryrefslogtreecommitdiff
path: root/src/_pytest/unittest.py
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2019-05-27 20:31:52 -0300
committerBruno Oliveira <nicoddemus@gmail.com>2019-06-02 14:39:11 -0300
commit4d49ba65297102110ae8aeecdb3b82b23a231fba (patch)
tree10a917331db131a6728775ff7d462732ff1f9466 /src/_pytest/unittest.py
parent733f43b02eafe2934c2e86b7d0370e25dfe95a48 (diff)
downloadpytest-4d49ba65297102110ae8aeecdb3b82b23a231fba.tar.gz
Drop Python 2.7 and 3.4 support
* Update setup.py requires and classifiers * Drop Python 2.7 and 3.4 from CI * Update docs dropping 2.7 and 3.4 support * Fix mock imports and remove tests related to pypi's mock module * Add py27 and 34 support docs to the sidebar * Remove usage of six from tmpdir * Remove six.PY* code blocks * Remove sys.version_info related code * Cleanup compat * Remove obsolete safe_str * Remove obsolete __unicode__ methods * Remove compat.PY35 and compat.PY36: not really needed anymore * Remove unused UNICODE_TYPES * Remove Jython specific code * Remove some Python 2 references from docs Related to #5275
Diffstat (limited to 'src/_pytest/unittest.py')
-rw-r--r--src/_pytest/unittest.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py
index e2e7efdc5..4380f1295 100644
--- a/src/_pytest/unittest.py
+++ b/src/_pytest/unittest.py
@@ -113,23 +113,9 @@ class TestCaseFunction(Function):
def setup(self):
self._testcase = self.parent.obj(self.name)
- self._fix_unittest_skip_decorator()
if hasattr(self, "_request"):
self._request._fillfixtures()
- def _fix_unittest_skip_decorator(self):
- """
- The @unittest.skip decorator calls functools.wraps(self._testcase)
- The call to functools.wraps() fails unless self._testcase
- has a __name__ attribute. This is usually automatically supplied
- if the test is a function or method, but we need to add manually
- here.
-
- See issue #1169
- """
- if sys.version_info[0] == 2:
- setattr(self._testcase, "__name__", self.name)
-
def teardown(self):
self._testcase = None
@@ -208,12 +194,7 @@ class TestCaseFunction(Function):
skip_why = getattr(
self._testcase.__class__, "__unittest_skip_why__", ""
) or getattr(testMethod, "__unittest_skip_why__", "")
- try: # PY3, unittest2 on PY2
- self._testcase._addSkip(self, self._testcase, skip_why)
- except TypeError: # PY2
- if sys.version_info[0] != 2:
- raise
- self._testcase._addSkip(self, skip_why)
+ self._testcase._addSkip(self, self._testcase, skip_why)
return True
return False