Commit 6596ba26 by Sébastien Eustace

Fix tests on Windows

parent e5638dff
...@@ -55,7 +55,7 @@ def test_wheel_c_extension(): ...@@ -55,7 +55,7 @@ def test_wheel_c_extension():
has_compiled_extension = False has_compiled_extension = False
for name in zip.namelist(): for name in zip.namelist():
if name.startswith("extended/extended") and name.endswith(".so"): if name.startswith("extended/extended") and name.endswith((".so", ".pyd")):
has_compiled_extension = True has_compiled_extension = True
assert has_compiled_extension assert has_compiled_extension
...@@ -172,7 +172,10 @@ def test_module_src(): ...@@ -172,7 +172,10 @@ def test_module_src():
zip = zipfile.ZipFile(str(whl)) zip = zipfile.ZipFile(str(whl))
try:
assert "module_src.py" in zip.namelist() assert "module_src.py" in zip.namelist()
finally:
zip.close()
def test_package_src(): def test_package_src():
...@@ -194,5 +197,8 @@ def test_package_src(): ...@@ -194,5 +197,8 @@ def test_package_src():
zip = zipfile.ZipFile(str(whl)) zip = zipfile.ZipFile(str(whl))
try:
assert "package_src/__init__.py" in zip.namelist() assert "package_src/__init__.py" in zip.namelist()
assert "package_src/module.py" in zip.namelist() assert "package_src/module.py" in zip.namelist()
finally:
zip.close()
...@@ -183,7 +183,8 @@ def test_find_files_to_add(): ...@@ -183,7 +183,8 @@ def test_find_files_to_add():
builder = SdistBuilder(poetry, NullVenv(), NullIO()) builder = SdistBuilder(poetry, NullVenv(), NullIO())
result = builder.find_files_to_add() result = builder.find_files_to_add()
assert result == [ assert sorted(result) == sorted(
[
Path("LICENSE"), Path("LICENSE"),
Path("README.rst"), Path("README.rst"),
Path("my_package/__init__.py"), Path("my_package/__init__.py"),
...@@ -193,6 +194,7 @@ def test_find_files_to_add(): ...@@ -193,6 +194,7 @@ def test_find_files_to_add():
Path("my_package/sub_pkg2/data2/data.json"), Path("my_package/sub_pkg2/data2/data.json"),
Path("pyproject.toml"), Path("pyproject.toml"),
] ]
)
def test_find_packages(): def test_find_packages():
......
...@@ -21,7 +21,10 @@ def test_poetry(): ...@@ -21,7 +21,10 @@ def test_poetry():
assert package.description == "Some description." assert package.description == "Some description."
assert package.authors == ["Sébastien Eustace <sebastien@eustace.io>"] assert package.authors == ["Sébastien Eustace <sebastien@eustace.io>"]
assert package.license.id == "MIT" assert package.license.id == "MIT"
assert str(package.readme.relative_to(fixtures_dir)) == "sample_project/README.rst" assert (
package.readme.relative_to(fixtures_dir).as_posix()
== "sample_project/README.rst"
)
assert package.homepage == "https://poetry.eustace.io" assert package.homepage == "https://poetry.eustace.io"
assert package.repository_url == "https://github.com/sdispater/poetry" assert package.repository_url == "https://github.com/sdispater/poetry"
assert package.keywords == ["packaging", "dependency", "poetry"] assert package.keywords == ["packaging", "dependency", "poetry"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment