classification
Title: Failed separate test_patch_propogrates_exc_on_exit in test_unittest
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, michael.foord, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-06-03 11:59 by serhiy.storchaka, last changed 2018-12-11 10:19 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8520 merged python-dev, 2018-07-28 11:28
PR 11031 merged miss-islington, 2018-12-07 23:31
PR 11032 merged miss-islington, 2018-12-07 23:31
Messages (5)
msg318534 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-06-03 11:59
$ ./python -m test -v -m test_patch_propogrates_exc_on_exit test_unittest
...
test_patch_propogrates_exc_on_exit (unittest.test.testmock.testpatch.PatchTest) ... ERROR

======================================================================
ERROR: test_patch_propogrates_exc_on_exit (unittest.test.testmock.testpatch.PatchTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/testmock/testpatch.py", line 1699, in test_patch_propogrates_exc_on_exit
    self.assertRaises(RuntimeError, test)
  File "/home/serhiy/py/cpython/Lib/unittest/case.py", line 743, in assertRaises
    return context.handle('assertRaises', args, kwargs)
  File "/home/serhiy/py/cpython/Lib/unittest/case.py", line 178, in handle
    callable_obj(*args, **kwargs)
  File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1183, in patched
    arg = patching.__enter__()
  File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1239, in __enter__
    self.target = self.getter()
  File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1409, in <lambda>
    getter = lambda: _importer(target)
  File "/home/serhiy/py/cpython/Lib/unittest/mock.py", line 1092, in _importer
    thing = __import__(import_path)
ModuleNotFoundError: No module named 'squizz'

----------------------------------------------------------------------
msg322637 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-07-29 16:18
Michael, could you please make a review? I'm not experienced with mock.patch, and don't know what this test do.
msg331365 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2018-12-07 23:30
New changeset 3cf74384b53b998fa846dc2590cedf9ad2a0d5fd by Brett Cannon (Anirudha Bose) in branch 'master':
bpo-33747: Avoid mutating the global sys.modules dict in unittest.mock tests (GH-8520)
https://github.com/python/cpython/commit/3cf74384b53b998fa846dc2590cedf9ad2a0d5fd
msg331599 - (view) Author: miss-islington (miss-islington) Date: 2018-12-11 10:17
New changeset 45a31a1ec11e75cd0ef487dd4cea7f9fc4f885c8 by Miss Islington (bot) in branch '3.7':
[3.7] bpo-33747: Avoid mutating the global sys.modules dict in unittest.mock tests (GH-8520) (GH-11031)
https://github.com/python/cpython/commit/45a31a1ec11e75cd0ef487dd4cea7f9fc4f885c8
msg331600 - (view) Author: miss-islington (miss-islington) Date: 2018-12-11 10:17
New changeset 7d9f21950927e7c7fe69e5edeb06023a963c6f68 by Miss Islington (bot) in branch '3.6':
[3.6] bpo-33747: Avoid mutating the global sys.modules dict in unittest.mock tests (GH-8520) (GH-11032)
https://github.com/python/cpython/commit/7d9f21950927e7c7fe69e5edeb06023a963c6f68
History
Date User Action Args
2018-12-11 10:19:06serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-12-11 10:17:41miss-islingtonsetmessages: + msg331600
2018-12-11 10:17:32miss-islingtonsetnosy: + miss-islington
messages: + msg331599
2018-12-07 23:31:14miss-islingtonsetpull_requests: + pull_request10269
2018-12-07 23:31:01miss-islingtonsetpull_requests: + pull_request10268
2018-12-07 23:30:44brett.cannonsetnosy: + brett.cannon
messages: + msg331365
2018-07-29 16:18:41serhiy.storchakasetmessages: + msg322637
2018-07-28 11:28:57python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request8035
2018-06-03 11:59:10serhiy.storchakacreate