0c8875
diff -up Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/case.py
0c8875
--- Python-3.2.2/Lib/unittest/case.py.add-rpmbuild-hooks-to-unittest	2011-09-03 12:16:44.000000000 -0400
0c8875
+++ Python-3.2.2/Lib/unittest/case.py	2011-09-09 06:35:16.365568382 -0400
0c8875
@@ -3,6 +3,7 @@
0c8875
 import sys
0c8875
 import functools
0c8875
 import difflib
0c8875
+import os
f5250e
 import logging
0c8875
 import pprint
0c8875
 import re
Robert Kuska a1c0d0
@@ -101,5 +102,21 @@ def expectedFailure(func):
f5250e
         raise self.test_case.failureException(msg)
0c8875
 
0c8875
+# Non-standard/downstream-only hooks for handling issues with specific test
0c8875
+# cases:
0c8875
+
0c8875
+def _skipInRpmBuild(reason):
0c8875
+    """
0c8875
+    Non-standard/downstream-only decorator for marking a specific unit test
0c8875
+    to be skipped when run within the %check of an rpmbuild.
0c8875
+
0c8875
+    Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
0c8875
+    the environment, and has no effect otherwise.
0c8875
+    """
0c8875
+    if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:
0c8875
+        return skip(reason)
0c8875
+    else:
0c8875
+        return _id
0c8875
+
f5250e
 class _AssertRaisesBaseContext(_BaseTestCaseContext):
0c8875
 
Matej Stuchlik abb2ff
     def __init__(self, expected, test_case, expected_regex=None):
0c8875
diff -up Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest Python-3.2.2/Lib/unittest/__init__.py
0c8875
--- Python-3.2.2/Lib/unittest/__init__.py.add-rpmbuild-hooks-to-unittest	2011-09-03 12:16:44.000000000 -0400
0c8875
+++ Python-3.2.2/Lib/unittest/__init__.py	2011-09-09 06:35:16.366568382 -0400
0c8875
@@ -57,7 +57,8 @@ __unittest = True
0c8875
 
0c8875
 from .result import TestResult
0c8875
 from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,
0c8875
-                   skipUnless, expectedFailure)
0c8875
+                   skipUnless, expectedFailure,
Robert Kuska f2e5fa
+                   _skipInRpmBuild)
0c8875
 from .suite import BaseTestSuite, TestSuite
0c8875
 from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,
0c8875
                      findTestCases)