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
66508bc6
Commit
66508bc6
authored
May 19, 2022
by
Arun Babu Neelicattu
Committed by
Bjorn Neergaard
May 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: cleanup installed repo mocking
parent
3b5bf01a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
tests/repositories/test_installed_repository.py
+14
-6
No files found.
tests/repositories/test_installed_repository.py
View file @
66508bc6
...
@@ -65,12 +65,8 @@ def env() -> MockEnv:
...
@@ -65,12 +65,8 @@ def env() -> MockEnv:
return
MockEnv
(
path
=
ENV_DIR
)
return
MockEnv
(
path
=
ENV_DIR
)
@pytest.fixture
@pytest.fixture
(
autouse
=
True
)
def
repository
(
mocker
:
MockerFixture
,
env
:
MockEnv
)
->
InstalledRepository
:
def
mock_git_info
(
mocker
:
MockerFixture
)
->
None
:
mocker
.
patch
(
"poetry.utils._compat.metadata.Distribution.discover"
,
return_value
=
INSTALLED_RESULTS
,
)
mocker
.
patch
(
mocker
.
patch
(
"poetry.vcs.git.Git.info"
,
"poetry.vcs.git.Git.info"
,
return_value
=
namedtuple
(
"GitRepoLocalInfo"
,
"origin revision"
)(
return_value
=
namedtuple
(
"GitRepoLocalInfo"
,
"origin revision"
)(
...
@@ -78,7 +74,19 @@ def repository(mocker: MockerFixture, env: MockEnv) -> InstalledRepository:
...
@@ -78,7 +74,19 @@ def repository(mocker: MockerFixture, env: MockEnv) -> InstalledRepository:
revision
=
"bb058f6b78b2d28ef5d9a5e759cfa179a1a713d6"
,
revision
=
"bb058f6b78b2d28ef5d9a5e759cfa179a1a713d6"
,
),
),
)
)
@pytest.fixture
(
autouse
=
True
)
def
mock_installed_repository_vendors
(
mocker
:
MockerFixture
)
->
None
:
mocker
.
patch
(
"poetry.repositories.installed_repository._VENDORS"
,
str
(
VENDOR_DIR
))
mocker
.
patch
(
"poetry.repositories.installed_repository._VENDORS"
,
str
(
VENDOR_DIR
))
@pytest.fixture
def
repository
(
mocker
:
MockerFixture
,
env
:
MockEnv
)
->
InstalledRepository
:
mocker
.
patch
(
"poetry.utils._compat.metadata.Distribution.discover"
,
return_value
=
INSTALLED_RESULTS
,
)
return
InstalledRepository
.
load
(
env
)
return
InstalledRepository
.
load
(
env
)
...
...
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