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
a514831e
Commit
a514831e
authored
Apr 15, 2022
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: ensure mocked config reuses global temp dir
This ensures clean up is consistent.
parent
0e5f953e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
tests/conftest.py
+6
-4
No files found.
tests/conftest.py
View file @
a514831e
...
@@ -190,13 +190,15 @@ def config(
...
@@ -190,13 +190,15 @@ def config(
return
c
return
c
@pytest.fixture
()
def
config_dir
(
tmp_dir
:
str
)
->
str
:
return
tempfile
.
mkdtemp
(
prefix
=
"poetry_config_"
,
dir
=
tmp_dir
)
@pytest.fixture
(
autouse
=
True
)
@pytest.fixture
(
autouse
=
True
)
def
mock_user_config_dir
(
mocker
:
MockerFixture
)
->
Iterator
[
None
]:
def
mock_user_config_dir
(
mocker
:
MockerFixture
,
config_dir
:
str
)
->
None
:
config_dir
=
tempfile
.
mkdtemp
(
prefix
=
"poetry_config_"
)
mocker
.
patch
(
"poetry.locations.CONFIG_DIR"
,
new
=
config_dir
)
mocker
.
patch
(
"poetry.locations.CONFIG_DIR"
,
new
=
config_dir
)
mocker
.
patch
(
"poetry.factory.CONFIG_DIR"
,
new
=
config_dir
)
mocker
.
patch
(
"poetry.factory.CONFIG_DIR"
,
new
=
config_dir
)
yield
shutil
.
rmtree
(
config_dir
,
ignore_errors
=
True
)
@pytest.fixture
(
autouse
=
True
)
@pytest.fixture
(
autouse
=
True
)
...
...
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