mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-20 01:24:42 +04:00
Merge pull request #1237 from pre-commit/actual_environment_python_test
Create an actual environment for python healthy() types test
This commit is contained in:
commit
6850c27dd6
2 changed files with 7 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ jobs:
|
||||||
name_postfix: _latest_git
|
name_postfix: _latest_git
|
||||||
pre_test:
|
pre_test:
|
||||||
- task: UseRubyVersion@0
|
- task: UseRubyVersion@0
|
||||||
- template: step--git-install.yml@asottile
|
- template: step--git-install.yml
|
||||||
- bash: |
|
- bash: |
|
||||||
testing/get-swift.sh
|
testing/get-swift.sh
|
||||||
echo '##vso[task.prependpath]/tmp/swift/usr/bin'
|
echo '##vso[task.prependpath]/tmp/swift/usr/bin'
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,11 @@ def test_find_by_sys_executable(exe, realpath, expected):
|
||||||
|
|
||||||
def test_healthy_types_py_in_cwd(tmpdir):
|
def test_healthy_types_py_in_cwd(tmpdir):
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
|
prefix = tmpdir.join('prefix').ensure_dir()
|
||||||
|
prefix.join('setup.py').write('import setuptools; setuptools.setup()')
|
||||||
|
prefix = Prefix(str(prefix))
|
||||||
|
python.install_environment(prefix, C.DEFAULT, ())
|
||||||
|
|
||||||
# even if a `types.py` file exists, should still be healthy
|
# even if a `types.py` file exists, should still be healthy
|
||||||
tmpdir.join('types.py').ensure()
|
tmpdir.join('types.py').ensure()
|
||||||
# this env doesn't actually exist (for test speed purposes)
|
assert python.healthy(prefix, C.DEFAULT) is True
|
||||||
assert python.healthy(Prefix(str(tmpdir)), C.DEFAULT) is True
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue