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
c99ae5f9
Unverified
Commit
c99ae5f9
authored
Nov 22, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
6c5be4b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
poetry/utils/env.py
+24
-2
tests/console/conftest.py
+3
-2
No files found.
poetry/utils/env.py
View file @
c99ae5f9
...
@@ -539,11 +539,22 @@ class NullEnv(SystemEnv):
...
@@ -539,11 +539,22 @@ class NullEnv(SystemEnv):
class
MockEnv
(
NullEnv
):
class
MockEnv
(
NullEnv
):
def
__init__
(
self
,
version_info
=
(
3
,
7
,
0
),
python_implementation
=
"cpython"
):
def
__init__
(
super
(
MockEnv
,
self
)
.
__init__
()
self
,
version_info
=
(
3
,
7
,
0
),
python_implementation
=
"CPython"
,
platform
=
"darwin"
,
os_name
=
"posix"
,
is_venv
=
False
,
**
kwargs
):
super
(
MockEnv
,
self
)
.
__init__
(
**
kwargs
)
self
.
_version_info
=
version_info
self
.
_version_info
=
version_info
self
.
_python_implementation
=
python_implementation
self
.
_python_implementation
=
python_implementation
self
.
_platform
=
platform
self
.
_os_name
=
os_name
self
.
_is_venv
=
is_venv
@property
@property
def
version_info
(
self
):
# type: () -> Tuple[int]
def
version_info
(
self
):
# type: () -> Tuple[int]
...
@@ -552,3 +563,14 @@ class MockEnv(NullEnv):
...
@@ -552,3 +563,14 @@ class MockEnv(NullEnv):
@property
@property
def
python_implementation
(
self
):
# type: () -> str
def
python_implementation
(
self
):
# type: () -> str
return
self
.
_python_implementation
return
self
.
_python_implementation
@property
def
platform
(
self
):
# type: () -> str
return
self
.
_platform
@property
def
os
(
self
):
# type: () -> str
return
self
.
_os_name
def
is_venv
(
self
):
# type: () -> bool
return
self
.
_is_venv
tests/console/conftest.py
View file @
c99ae5f9
...
@@ -50,7 +50,9 @@ def installed():
...
@@ -50,7 +50,9 @@ def installed():
@pytest.fixture
(
autouse
=
True
)
@pytest.fixture
(
autouse
=
True
)
def
setup
(
mocker
,
installer
,
installed
):
def
setup
(
mocker
,
installer
,
installed
):
Env
.
_env
=
MockEnv
()
mocker
.
patch
(
"poetry.utils.env.Env.get"
,
return_value
=
MockEnv
(
is_venv
=
True
,
execute
=
True
)
)
# Set Installer's installer
# Set Installer's installer
p
=
mocker
.
patch
(
"poetry.installation.installer.Installer._get_installer"
)
p
=
mocker
.
patch
(
"poetry.installation.installer.Installer._get_installer"
)
...
@@ -78,7 +80,6 @@ def setup(mocker, installer, installed):
...
@@ -78,7 +80,6 @@ def setup(mocker, installer, installed):
os
.
environ
.
clear
()
os
.
environ
.
clear
()
os
.
environ
.
update
(
environ
)
os
.
environ
.
update
(
environ
)
Env
.
_env
=
None
class
Application
(
BaseApplication
):
class
Application
(
BaseApplication
):
...
...
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