Contribute our local fix upstream to Python #215
Replies: 4 comments
-
I finally sat down to do this today and discovered that this was fixed as part of python/cpython#9190 that was included in Python 3.8. The new task for this issue is:
UPDATE: Nope, I was wrong. See later comment: #215 (comment) |
Beta Was this translation helpful? Give feedback.
-
Hmm...it appears the different way that they fixed the problem interacts badly with how we count up skipped tests...so I'll have to look into that. 🤦♂
UPDATE: Nope, I was wrong. See later comment: #215 (comment) Failure in green.test.test_suite.TestFunctional.test_skip_in_setUpClass
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
yield
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 676, in run
self._callTestMethod(testMethod)
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
method()
File "/home/travis/build/CleanCut/green/green/test/test_suite.py", line 157, in test_skip_in_setUpClass
self.assertEqual(len(result.skipped), 2)
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 912, in assertEqual
assertion_func(first, second, msg=msg)
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 905, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 0 != 2
###
Error in green.test.test_suite.TestGreenTestSuite.test_skip_in_setUpClass
File "/opt/python/3.8.0/lib/python3.8/unittest/suite.py", line 163, in _handleClassSetUp
setUpClass()
File "/opt/python/3.8.0/lib/python3.8/unittest/mock.py", line 1075, in __call__
return self._mock_call(*args, **kwargs)
File "/opt/python/3.8.0/lib/python3.8/unittest/mock.py", line 1079, in _mock_call
return self._execute_mock_call(*args, **kwargs)
File "/opt/python/3.8.0/lib/python3.8/unittest/mock.py", line 1134, in _execute_mock_call
raise effect
unittest.case.SkipTest: kaboom
During handling of the above exception, another exception occurred:
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
yield
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 676, in run
self._callTestMethod(testMethod)
File "/opt/python/3.8.0/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
method()
File "/home/travis/build/CleanCut/green/green/test/test_suite.py", line 104, in test_skip_in_setUpClass
gts._handleClassSetUp(mock_test, mock_result)
File "/opt/python/3.8.0/lib/python3.8/unittest/suite.py", line 168, in _handleClassSetUp
className = util.strclass(currentClass)
File "/opt/python/3.8.0/lib/python3.8/unittest/util.py", line 55, in strclass
return "%s.%s" % (cls.__module__, cls.__qualname__)
File "/opt/python/3.8.0/lib/python3.8/unittest/mock.py", line 637, in __getattr__
raise AttributeError(name)
AttributeError: __qualname__ |
Beta Was this translation helpful? Give feedback.
-
Found and fixed the problem in I suspect the other failure is a similar failure due to reliance on unittest internals. Hopefully I can track that down as well. |
Beta Was this translation helpful? Give feedback.
-
Nope, I was completely wrong. The change in Python 3.8 did not fix the problem, it just changed code that broke our monkey patch to the problem. I added a new, updated monkey-patch in 9f393ed Now the task in this issue reverts to:
|
Beta Was this translation helpful? Give feedback.
-
These lines are a monkey-patch I made for unittest to work around an upstream bug that was reported in #159
Let's contribute that fix upstream to Python! Then maybe we could not monkey patch our stuff.
I'm pretty busy, so if someone else wants to do the honors, please go ahead. If not, I'll add myself as an "assignee" when I finally get around to it.
Beta Was this translation helpful? Give feedback.
All reactions