Skip to content

Conversation

@jaraco
Copy link
Member

@jaraco jaraco commented Jun 17, 2022

Fixes gh-93951

@jaraco jaraco changed the title bpo-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers. gh-93951: In test_bdb.StateTestCase.test_skip, avoid including auxiliary importers. Jun 17, 2022
@jaraco jaraco force-pushed the gh-93951/test-bdb-meta-path-sensitivity branch from df5bcf2 to d36b0dd Compare June 17, 2022 19:21
@jaraco jaraco force-pushed the gh-93951/test-bdb-meta-path-sensitivity branch from d36b0dd to 27d86b9 Compare June 18, 2022 00:21
Copy link
Member

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One PEP 8 violation, but otherwise LGTM!

Co-authored-by: Brett Cannon <brett@python.org>
@tiran
Copy link
Member

tiran commented Jun 22, 2022

Why is the new helper method needed? The case looks like a job for https://docs.python.org/3/library/unittest.mock.html#unittest.mock.patch

@ambv
Copy link
Contributor

ambv commented Jun 22, 2022

@serhiy-storchaka points out that the new patch_list helper preserves identity of the patched list which might be an important property for some use cases. In particular, looks like sys.meta_path manipulation in tests always preserves the list's identity. Let's keep this then.

@ambv ambv merged commit c029b55 into main Jun 22, 2022
@ambv ambv deleted the gh-93951/test-bdb-meta-path-sensitivity branch June 22, 2022 12:05
@miss-islington
Copy link
Contributor

Thanks @jaraco for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-94118 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed needs backport to 3.11 only security fixes needs backport to 3.10 only security fixes labels Jun 22, 2022
@bedevere-bot
Copy link

GH-94119 is a backport of this pull request to the 3.10 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_bdb is sensitive to sys.meta_path manipulation

7 participants