2019-02-05 00:40:25 +00:00
|
|
|
diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py
|
|
|
|
index 5ff1bf3..4d63954 100644
|
|
|
|
--- a/Lib/unittest/__init__.py
|
|
|
|
+++ b/Lib/unittest/__init__.py
|
|
|
|
@@ -58,7 +58,7 @@ __unittest = True
|
|
|
|
|
|
|
|
from .result import TestResult
|
|
|
|
from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip,
|
|
|
|
- skipIf, skipUnless, expectedFailure)
|
|
|
|
+ skipIf, skipUnless, expectedFailure, _skipInRpmBuild)
|
|
|
|
from .suite import BaseTestSuite, TestSuite
|
|
|
|
from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,
|
|
|
|
findTestCases)
|
|
|
|
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py
|
|
|
|
index a157ae8..64f912c 100644
|
|
|
|
--- a/Lib/unittest/case.py
|
|
|
|
+++ b/Lib/unittest/case.py
|
2011-09-10 11:59:22 +00:00
|
|
|
@@ -3,6 +3,7 @@
|
|
|
|
import sys
|
|
|
|
import functools
|
|
|
|
import difflib
|
|
|
|
+import os
|
Update to Python 3.4 alpha 4.
- Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib),
114 (statvfs flags), 132 (unittest rpmbuild hooks), 134 (fix COUNT_ALLOCS in
test_sys), 143 (tsc on ppc64), 146 (hashlib fips), 153 (test gdb noise),
157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port), 186 (dont raise
from py_compile)
- Removed patches: 129 (test_subprocess nonreadable dir - no longer fails in
Koji), 142 (the mock issue that caused this is fixed)
- Added patch 187 (remove thread atfork) - will be in next version
- Refreshed script for checking pyc and pyo timestamps with new ignored files.
- The fips patch is disabled for now until upstream makes a final decision
what to do with sha3 implementation for 3.4.0.
2013-11-05 11:39:14 +00:00
|
|
|
import logging
|
2011-09-10 11:59:22 +00:00
|
|
|
import pprint
|
|
|
|
import re
|
2019-02-05 00:40:25 +00:00
|
|
|
@@ -158,6 +159,22 @@ class _BaseTestCaseContext:
|
|
|
|
msg = self.test_case._formatMessage(self.msg, standardMsg)
|
Update to Python 3.4 alpha 4.
- Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib),
114 (statvfs flags), 132 (unittest rpmbuild hooks), 134 (fix COUNT_ALLOCS in
test_sys), 143 (tsc on ppc64), 146 (hashlib fips), 153 (test gdb noise),
157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port), 186 (dont raise
from py_compile)
- Removed patches: 129 (test_subprocess nonreadable dir - no longer fails in
Koji), 142 (the mock issue that caused this is fixed)
- Added patch 187 (remove thread atfork) - will be in next version
- Refreshed script for checking pyc and pyo timestamps with new ignored files.
- The fips patch is disabled for now until upstream makes a final decision
what to do with sha3 implementation for 3.4.0.
2013-11-05 11:39:14 +00:00
|
|
|
raise self.test_case.failureException(msg)
|
2011-09-10 11:59:22 +00:00
|
|
|
|
|
|
|
+# Non-standard/downstream-only hooks for handling issues with specific test
|
|
|
|
+# cases:
|
|
|
|
+
|
|
|
|
+def _skipInRpmBuild(reason):
|
|
|
|
+ """
|
|
|
|
+ Non-standard/downstream-only decorator for marking a specific unit test
|
|
|
|
+ to be skipped when run within the %check of an rpmbuild.
|
|
|
|
+
|
|
|
|
+ Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
|
|
|
|
+ the environment, and has no effect otherwise.
|
|
|
|
+ """
|
|
|
|
+ if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
|
|
|
|
+ return skip(reason)
|
|
|
|
+ else:
|
|
|
|
+ return _id
|
|
|
|
+
|
Update to Python 3.4 alpha 4.
- Refreshed patches: 55 (systemtap), 102 (lib64), 111 (no static lib),
114 (statvfs flags), 132 (unittest rpmbuild hooks), 134 (fix COUNT_ALLOCS in
test_sys), 143 (tsc on ppc64), 146 (hashlib fips), 153 (test gdb noise),
157 (UID+GID overflows), 173 (ENOPROTOOPT in bind_port), 186 (dont raise
from py_compile)
- Removed patches: 129 (test_subprocess nonreadable dir - no longer fails in
Koji), 142 (the mock issue that caused this is fixed)
- Added patch 187 (remove thread atfork) - will be in next version
- Refreshed script for checking pyc and pyo timestamps with new ignored files.
- The fips patch is disabled for now until upstream makes a final decision
what to do with sha3 implementation for 3.4.0.
2013-11-05 11:39:14 +00:00
|
|
|
class _AssertRaisesBaseContext(_BaseTestCaseContext):
|
2011-09-10 11:59:22 +00:00
|
|
|
|
2015-09-16 06:36:17 +00:00
|
|
|
def __init__(self, expected, test_case, expected_regex=None):
|