bpo-33465: Use an unlikely to be built-in C extension in a test by warsaw · Pull Request #6797 · python/cpython

@warsaw

@warsaw

@warsaw

zware


def test_from_import_missing_attr_has_name_and_so_path(self):
import select
import _hashlib

Choose a reason for hiding this comment

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

It's pretty easy for _hashlib to just not exist, for instance if OpenSSL is not available. How about _testcapi?

Choose a reason for hiding this comment

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

Okay, after talking with @doko42 we think _testcapi is a good choice. We need to find one that will always be built and is not a built-in (on Debian).

Choose a reason for hiding this comment

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

Same in Fedora; _testcapi sounds like a good choice.
(It's always built, as a shared library. Then it's packaged in python3-tests so it's not necessarily installed on all systems.)

@warsaw

@warsaw

zware

Choose a reason for hiding this comment

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

I wonder if this test should be guarded by @cpython_only? Otherwise, LGTM.

@warsaw

@warsaw warsaw changed the title bpo-33465: Use binascii, as it's less likely to be built-in bpo-33465: Use an unlikely to be built-in C extension in a test

May 15, 2018

@warsaw

@zware Good point. Done. And thanks for the approval; I'll merge this once CI passes.

@bedevere-bot

@warsaw: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington

Thanks @warsaw for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 15, 2018
…onGH-6797)

(cherry picked from commit 8709b23)

Co-authored-by: Barry Warsaw <barry@python.org>

@bedevere-bot

warsaw added a commit that referenced this pull request

May 15, 2018
) (#6869)

(cherry picked from commit 8709b23)

Co-authored-by: Barry Warsaw <barry@python.org>