Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
96bc4ee3
Unverified
Commit
96bc4ee3
authored
Sep 13, 2021
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests on windows
parent
041e10f7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
tests/console/commands/env/test_info.py
+1
-2
tests/utils/test_env.py
+11
-1
No files found.
tests/console/commands/env/test_info.py
View file @
96bc4ee3
...
@@ -4,7 +4,6 @@ from pathlib import Path
...
@@ -4,7 +4,6 @@ from pathlib import Path
import
pytest
import
pytest
from
poetry.utils._compat
import
WINDOWS
from
poetry.utils.env
import
MockEnv
from
poetry.utils.env
import
MockEnv
...
@@ -45,7 +44,7 @@ Executable: {base_executable}
...
@@ -45,7 +44,7 @@ Executable: {base_executable}
base_prefix
=
str
(
Path
(
"/base/prefix"
)),
base_prefix
=
str
(
Path
(
"/base/prefix"
)),
base_version
=
"."
.
join
(
str
(
v
)
for
v
in
sys
.
version_info
[:
3
]),
base_version
=
"."
.
join
(
str
(
v
)
for
v
in
sys
.
version_info
[:
3
]),
executable
=
sys
.
executable
,
executable
=
sys
.
executable
,
base_executable
=
"python"
+
(
".exe"
if
WINDOWS
else
""
)
,
base_executable
=
"python"
,
)
)
assert
expected
==
tester
.
io
.
fetch_output
()
assert
expected
==
tester
.
io
.
fetch_output
()
...
...
tests/utils/test_env.py
View file @
96bc4ee3
...
@@ -1001,7 +1001,7 @@ def test_env_finds_the_correct_executables(tmp_dir, manager):
...
@@ -1001,7 +1001,7 @@ def test_env_finds_the_correct_executables(tmp_dir, manager):
venv
=
VirtualEnv
(
venv_path
)
venv
=
VirtualEnv
(
venv_path
)
assert
Path
(
venv
.
python
)
.
name
==
expected_executable
assert
Path
(
venv
.
python
)
.
name
==
expected_executable
assert
Path
(
venv
.
pip
)
.
name
==
expected_pip_executable
assert
Path
(
venv
.
pip
)
.
name
.
startswith
(
expected_pip_executable
.
split
(
"."
)[
0
])
def
test_env_finds_the_correct_executables_for_generic_env
(
tmp_dir
,
manager
):
def
test_env_finds_the_correct_executables_for_generic_env
(
tmp_dir
,
manager
):
...
@@ -1021,6 +1021,10 @@ def test_env_finds_the_correct_executables_for_generic_env(tmp_dir, manager):
...
@@ -1021,6 +1021,10 @@ def test_env_finds_the_correct_executables_for_generic_env(tmp_dir, manager):
sys
.
version_info
[
0
],
sys
.
version_info
[
1
],
".exe"
if
WINDOWS
else
""
sys
.
version_info
[
0
],
sys
.
version_info
[
1
],
".exe"
if
WINDOWS
else
""
)
)
if
WINDOWS
:
expected_executable
=
"python.exe"
expected_pip_executable
=
"pip.exe"
assert
Path
(
venv
.
python
)
.
name
==
expected_executable
assert
Path
(
venv
.
python
)
.
name
==
expected_executable
assert
Path
(
venv
.
pip
)
.
name
==
expected_pip_executable
assert
Path
(
venv
.
pip
)
.
name
==
expected_pip_executable
...
@@ -1079,6 +1083,12 @@ def test_env_finds_fallback_executables_for_generic_env(tmp_dir, manager):
...
@@ -1079,6 +1083,12 @@ def test_env_finds_fallback_executables_for_generic_env(tmp_dir, manager):
venv
.
_bin_dir
.
joinpath
(
expected_pip_executable
)
.
unlink
()
venv
.
_bin_dir
.
joinpath
(
expected_pip_executable
)
.
unlink
()
expected_pip_executable
=
default_pip_executable
expected_pip_executable
=
default_pip_executable
if
not
venv
.
_bin_dir
.
joinpath
(
expected_executable
)
.
exists
():
expected_executable
=
default_executable
if
not
venv
.
_bin_dir
.
joinpath
(
expected_pip_executable
)
.
exists
():
expected_pip_executable
=
default_pip_executable
venv
=
GenericEnv
(
parent_venv
.
path
,
child_env
=
VirtualEnv
(
child_venv_path
))
venv
=
GenericEnv
(
parent_venv
.
path
,
child_env
=
VirtualEnv
(
child_venv_path
))
assert
Path
(
venv
.
python
)
.
name
==
expected_executable
assert
Path
(
venv
.
python
)
.
name
==
expected_executable
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment