Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Run tests against pre-built/installed version of setuptools #3049

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use temporary module for test_require_present
abravalheri committed Jan 24, 2022
commit 4978518980da3d29316fa79ca32020e42718dbf3
10 changes: 6 additions & 4 deletions setuptools/tests/test_setuptools.py
Original file line number Diff line number Diff line change
@@ -110,19 +110,21 @@ def testRequire(self):
assert not req.is_current()

@needs_bytecode
def test_require_present(self):
def test_require_present(self, tmp_path):
# In #1896, this test was failing for months with the only
# complaint coming from test runners (not end users).
# TODO: Evaluate if this code is needed at all.
req = Require('Tests', None, 'tests', homepage="http://example.com")
mod = (tmp_path / "module_under_test.py")
mod.write_text("hello_world = True")

req = Require('Tests', None, "module_under_test", homepage="http://example.com")
assert req.format is None
assert req.attribute is None
assert req.requested_version is None
assert req.full_name() == 'Tests'
assert req.homepage == 'http://example.com'

from . import __path__
paths = [os.path.dirname(os.path.dirname(p)) for p in __path__]
paths = [str(tmp_path)]
assert req.is_present(paths)
assert req.is_current(paths)