Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
9e314980
Commit
9e314980
authored
Dec 31, 2019
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove instance attribute; rely on tmpdir fixture; re-use touch helper.
parent
9c40ab88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
setuptools/tests/test_sdist.py
setuptools/tests/test_sdist.py
+7
-8
No files found.
setuptools/tests/test_sdist.py
View file @
9e314980
...
...
@@ -98,7 +98,6 @@ def touch(path):
class
TestSdistTest
:
@
pytest
.
fixture
(
autouse
=
True
)
def
source_dir
(
self
,
tmpdir
):
self
.
temp_dir
=
str
(
tmpdir
)
(
tmpdir
/
'setup.py'
).
write_text
(
SETUP_PY
,
encoding
=
'utf-8'
)
# Set up the rest of the test package
...
...
@@ -176,14 +175,14 @@ class TestSdistTest:
manifest
=
cmd
.
filelist
.
files
assert
'setup.py'
not
in
manifest
def
test_defaults_case_sensitivity
(
self
):
def
test_defaults_case_sensitivity
(
self
,
tmpdir
):
"""
Make sure default files (README.*, etc.) are added in a case-sensitive
way to avoid problems with packages built on Windows.
"""
open
(
os
.
path
.
join
(
self
.
temp_dir
,
'readme.rst'
),
'w'
).
close
(
)
open
(
os
.
path
.
join
(
self
.
temp_dir
,
'SETUP.cfg'
),
'w'
).
close
(
)
touch
(
tmpdir
/
'readme.rst'
)
touch
(
tmpdir
/
'SETUP.cfg'
)
dist
=
Distribution
(
SETUP_ATTRS
)
# the extension deliberately capitalized for this test
...
...
@@ -450,11 +449,11 @@ class TestSdistTest:
except
UnicodeDecodeError
:
filename
not
in
cmd
.
filelist
.
files
def
test_pyproject_toml_in_sdist
(
self
):
def
test_pyproject_toml_in_sdist
(
self
,
tmpdir
):
"""
Check if pyproject.toml is included in source distribution if present
"""
open
(
os
.
path
.
join
(
self
.
temp_dir
,
'pyproject.toml'
),
'w'
).
close
(
)
touch
(
tmpdir
/
'pyproject.toml'
)
dist
=
Distribution
(
SETUP_ATTRS
)
dist
.
script_name
=
'setup.py'
cmd
=
sdist
(
dist
)
...
...
@@ -464,11 +463,11 @@ class TestSdistTest:
manifest
=
cmd
.
filelist
.
files
assert
'pyproject.toml'
in
manifest
def
test_pyproject_toml_excluded
(
self
):
def
test_pyproject_toml_excluded
(
self
,
tmpdir
):
"""
Check that pyproject.toml can excluded even if present
"""
open
(
os
.
path
.
join
(
self
.
temp_dir
,
'pyproject.toml'
),
'w'
).
close
(
)
touch
(
tmpdir
/
'pyproject.toml'
)
with
open
(
'MANIFEST.in'
,
'w'
)
as
mts
:
print
(
'exclude pyproject.toml'
,
file
=
mts
)
dist
=
Distribution
(
SETUP_ATTRS
)
...
...
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