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
ec98cdc0
Commit
ec98cdc0
authored
Jul 27, 2018
by
Jake Bier
Committed by
Sébastien Eustace
Jul 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Release file handles in tests (#324)
parent
ceb48cd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
55 deletions
+42
-55
tests/masonry/builders/test_complete.py
+7
-10
tests/masonry/builders/test_sdist.py
+26
-32
tests/masonry/builders/test_wheel.py
+9
-13
No files found.
tests/masonry/builders/test_complete.py
View file @
ec98cdc0
...
...
@@ -47,10 +47,9 @@ def test_wheel_c_extension():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"extended-0.1/build.py"
in
tar
.
getnames
()
assert
"extended-0.1/extended/extended.c"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"extended-0.1/build.py"
in
tar
.
getnames
()
assert
"extended-0.1/extended/extended.c"
in
tar
.
getnames
()
whl
=
list
((
module_path
/
"dist"
)
.
glob
(
"extended-0.1-cp*-cp*-*.whl"
))[
0
]
...
...
@@ -167,9 +166,8 @@ def test_module_src():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"module-src-0.1/src/module_src.py"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"module-src-0.1/src/module_src.py"
in
tar
.
getnames
()
whl
=
module_path
/
"dist"
/
"module_src-0.1-py2.py3-none-any.whl"
...
...
@@ -192,9 +190,8 @@ def test_package_src():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"package-src-0.1/src/package_src/module.py"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"package-src-0.1/src/package_src/module.py"
in
tar
.
getnames
()
whl
=
module_path
/
"dist"
/
"package_src-0.1-py2.py3-none-any.whl"
...
...
tests/masonry/builders/test_sdist.py
View file @
ec98cdc0
...
...
@@ -239,9 +239,8 @@ def test_package():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"my-package-1.2.3/LICENSE"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"my-package-1.2.3/LICENSE"
in
tar
.
getnames
()
def
test_module
():
...
...
@@ -254,9 +253,8 @@ def test_module():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"module1-0.1/module1.py"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"module1-0.1/module1.py"
in
tar
.
getnames
()
def
test_prelease
():
...
...
@@ -280,10 +278,9 @@ def test_with_c_extensions():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"extended-0.1/build.py"
in
tar
.
getnames
()
assert
"extended-0.1/extended/extended.c"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"extended-0.1/build.py"
in
tar
.
getnames
()
assert
"extended-0.1/extended/extended.c"
in
tar
.
getnames
()
def
test_with_src_module_file
():
...
...
@@ -307,9 +304,8 @@ def test_with_src_module_file():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"module-src-0.1/src/module_src.py"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"module-src-0.1/src/module_src.py"
in
tar
.
getnames
()
def
test_with_src_module_dir
():
...
...
@@ -333,10 +329,9 @@ def test_with_src_module_dir():
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
assert
"package-src-0.1/src/package_src/__init__.py"
in
tar
.
getnames
()
assert
"package-src-0.1/src/package_src/module.py"
in
tar
.
getnames
()
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
assert
"package-src-0.1/src/package_src/__init__.py"
in
tar
.
getnames
()
assert
"package-src-0.1/src/package_src/module.py"
in
tar
.
getnames
()
def
test_package_with_include
(
mocker
):
...
...
@@ -380,21 +375,20 @@ def test_package_with_include(mocker):
assert
sdist
.
exists
()
tar
=
tarfile
.
open
(
str
(
sdist
),
"r"
)
names
=
tar
.
getnames
()
assert
"with-include-1.2.3/LICENSE"
in
names
assert
"with-include-1.2.3/README.rst"
in
names
assert
"with-include-1.2.3/extra_dir/__init__.py"
in
names
assert
"with-include-1.2.3/extra_dir/vcs_excluded.txt"
in
names
assert
"with-include-1.2.3/extra_dir/sub_pkg/__init__.py"
in
names
assert
"with-include-1.2.3/extra_dir/sub_pkg/vcs_excluded.txt"
not
in
names
assert
"with-include-1.2.3/my_module.py"
in
names
assert
"with-include-1.2.3/notes.txt"
in
names
assert
"with-include-1.2.3/package_with_include/__init__.py"
in
names
assert
"with-include-1.2.3/pyproject.toml"
in
names
assert
"with-include-1.2.3/setup.py"
in
names
assert
"with-include-1.2.3/PKG-INFO"
in
names
with
tarfile
.
open
(
str
(
sdist
),
"r"
)
as
tar
:
names
=
tar
.
getnames
()
assert
"with-include-1.2.3/LICENSE"
in
names
assert
"with-include-1.2.3/README.rst"
in
names
assert
"with-include-1.2.3/extra_dir/__init__.py"
in
names
assert
"with-include-1.2.3/extra_dir/vcs_excluded.txt"
in
names
assert
"with-include-1.2.3/extra_dir/sub_pkg/__init__.py"
in
names
assert
"with-include-1.2.3/extra_dir/sub_pkg/vcs_excluded.txt"
not
in
names
assert
"with-include-1.2.3/my_module.py"
in
names
assert
"with-include-1.2.3/notes.txt"
in
names
assert
"with-include-1.2.3/package_with_include/__init__.py"
in
names
assert
"with-include-1.2.3/pyproject.toml"
in
names
assert
"with-include-1.2.3/setup.py"
in
names
assert
"with-include-1.2.3/PKG-INFO"
in
names
def
test_proper_python_requires_if_single_version_specified
():
...
...
tests/masonry/builders/test_wheel.py
View file @
ec98cdc0
...
...
@@ -35,9 +35,8 @@ def test_wheel_module():
assert
whl
.
exists
()
z
=
zipfile
.
ZipFile
(
str
(
whl
))
assert
"module1.py"
in
z
.
namelist
()
with
zipfile
.
ZipFile
(
str
(
whl
))
as
z
:
assert
"module1.py"
in
z
.
namelist
()
def
test_wheel_package
():
...
...
@@ -48,9 +47,8 @@ def test_wheel_package():
assert
whl
.
exists
()
z
=
zipfile
.
ZipFile
(
str
(
whl
))
assert
"my_package/sub_pkg1/__init__.py"
in
z
.
namelist
()
with
zipfile
.
ZipFile
(
str
(
whl
))
as
z
:
assert
"my_package/sub_pkg1/__init__.py"
in
z
.
namelist
()
def
test_wheel_prerelease
():
...
...
@@ -70,10 +68,9 @@ def test_wheel_package_src():
assert
whl
.
exists
()
z
=
zipfile
.
ZipFile
(
str
(
whl
))
assert
"package_src/__init__.py"
in
z
.
namelist
()
assert
"package_src/module.py"
in
z
.
namelist
()
with
zipfile
.
ZipFile
(
str
(
whl
))
as
z
:
assert
"package_src/__init__.py"
in
z
.
namelist
()
assert
"package_src/module.py"
in
z
.
namelist
()
def
test_wheel_module_src
():
...
...
@@ -84,6 +81,5 @@ def test_wheel_module_src():
assert
whl
.
exists
()
z
=
zipfile
.
ZipFile
(
str
(
whl
))
assert
"module_src.py"
in
z
.
namelist
()
with
zipfile
.
ZipFile
(
str
(
whl
))
as
z
:
assert
"module_src.py"
in
z
.
namelist
()
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