Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6850c27

Browse files
authored
Merge pull request #1237 from pre-commit/actual_environment_python_test
Create an actual environment for python healthy() types test
2 parents fe10811 + 2cff185 commit 6850c27

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name_postfix: _latest_git
3030
pre_test:
3131
- task: UseRubyVersion@0
32-
- template: step--git-install.yml@asottile
32+
- template: step--git-install.yml
3333
- bash: |
3434
testing/get-swift.sh
3535
echo '##vso[task.prependpath]/tmp/swift/usr/bin'

tests/languages/python_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ def test_find_by_sys_executable(exe, realpath, expected):
5454

5555
def test_healthy_types_py_in_cwd(tmpdir):
5656
with tmpdir.as_cwd():
57+
prefix = tmpdir.join('prefix').ensure_dir()
58+
prefix.join('setup.py').write('import setuptools; setuptools.setup()')
59+
prefix = Prefix(str(prefix))
60+
python.install_environment(prefix, C.DEFAULT, ())
61+
5762
# even if a `types.py` file exists, should still be healthy
5863
tmpdir.join('types.py').ensure()
59-
# this env doesn't actually exist (for test speed purposes)
60-
assert python.healthy(Prefix(str(tmpdir)), C.DEFAULT) is True
64+
assert python.healthy(prefix, C.DEFAULT) is True

0 commit comments

Comments
 (0)