+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-whey-pth-0.0.4-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-whey-pth-0.0.4-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
Test session started at 16:53:07
rootdir: /home/tkloczko/rpmbuild/BUILD/whey-pth-0.0.4, configfile: tox.ini
plugins: datadir-1.3.1, regressions-2.3.1, timeout-2.1.0
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected 9 items
tests/test_whey_pth.py FFFFFFF.. [100%]
================================================================================= FAILURES =================================================================================
_____________________________________________________________________ test_build_complete[WHEY_NO_PTH] _____________________________________________________________________
config = '[build-system]\nrequires = [ "whey",]\nbuild-backend = "whey"\n\n[project]\nname = "whey"\nversion = "2021.0.0"\ndesc...\nplatforms = [ "Windows", "macOS", "Linux",]\nlicense-key = "MIT"\n\n[tool.whey.builders]\nwheel = "whey_pth_wheel"\n'
tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-50/test_build_complete_WHEY_NO_PT0')
advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f0fd596a370>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x7f0fd596a4f0>, capsys = <_pytest.capture.CaptureFixture object at 0x7f0fd596a700>
@pytest.mark.parametrize(
"config",
[
pytest.param(WHEY_NO_PTH, id="WHEY_NO_PTH"),
pytest.param(COMPLETE_A, id="COMPLETE_A"),
pytest.param(COMPLETE_B, id="COMPLETE_B"),
]
)
def test_build_complete(
config: str,
tmp_pathplus: PathPlus,
advanced_data_regression: AdvancedDataRegressionFixture,
file_regression: FileRegressionFixture,
capsys,
):
(tmp_pathplus / "pyproject.toml").write_clean(config)
(tmp_pathplus / "whey").mkdir()
(tmp_pathplus / "whey" / "__init__.py").write_clean("print('hello world)")
(tmp_pathplus / "README.rst").write_clean("Spam Spam Spam Spam")
(tmp_pathplus / "LICENSE").write_clean("This is the license")
(tmp_pathplus / "requirements.txt").write_clean("domdf_python_tools")
data = {}
with tempfile.TemporaryDirectory() as tmpdir:
wheel_builder = PthWheelBuilder(
project_dir=tmp_pathplus,
config=load_toml(tmp_pathplus / "pyproject.toml"),
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
wheel = wheel_builder.build_wheel()
assert (tmp_pathplus / wheel).is_file()
zip_file = zipfile.ZipFile(tmp_pathplus / wheel)
data["wheel_content"] = sorted(zip_file.namelist())
with zip_file.open("whey/__init__.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with zip_file.open("whey-2021.0.0.dist-info/METADATA", mode='r') as fp:
check_file_regression(fp.read().decode("UTF-8"), file_regression)
if config != WHEY_NO_PTH:
with zip_file.open("my_project.pth", mode='r') as fp:
assert fp.read().decode("UTF-8") == "import _virtualenv\n"
with tempfile.TemporaryDirectory() as tmpdir:
sdist_builder = SDistBuilder(
project_dir=tmp_pathplus,
config=load_toml(tmp_pathplus / "pyproject.toml"),
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
sdist = sdist_builder.build_sdist()
assert (tmp_pathplus / sdist).is_file()
tar = tarfile.open(tmp_pathplus / sdist)
data["sdist_content"] = sorted(tar.getnames())
with tar.extractfile("whey-2021.0.0/whey/__init__.py") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with tar.extractfile("whey-2021.0.0/README.rst") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "Spam Spam Spam Spam\n"
with tar.extractfile("whey-2021.0.0/LICENSE") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "This is the license\n"
with tar.extractfile("whey-2021.0.0/requirements.txt") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "domdf_python_tools\n"
outerr = capsys.readouterr()
data["stdout"] = outerr.out.replace(tmp_pathplus.as_posix(), "...")
data["stderr"] = outerr.err
> advanced_data_regression.check(data)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_WHEY_NO_PT0/test_whey_pth_/test_build_complete_WHEY_NO_PTH_.yml
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_WHEY_NO_PT0/test_whey_pth_/test_build_complete_WHEY_NO_PTH_.obtained.yml
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_WHEY_NO_PT0/test_whey_pth_/test_build_complete_WHEY_NO_PTH_.obtained.diff.html
E ---
E +++
E @@ -15,8 +15,6 @@
E Writing whey-2021.0.0.dist-info/METADATA
E
E Writing whey-2021.0.0.dist-info/WHEEL
E -
E - Writing whey-2021.0.0.dist-info/top_level.txt
E
E Writing whey-2021.0.0.dist-info/RECORD
E
E @@ -43,5 +41,4 @@
E - whey-2021.0.0.dist-info/RECORD
E - whey-2021.0.0.dist-info/WHEEL
E - whey-2021.0.0.dist-info/entry_points.txt
E -- whey-2021.0.0.dist-info/top_level.txt
E - whey/__init__.py
tests/test_whey_pth.py:232: AssertionError
_____________________________________________________________________ test_build_complete[COMPLETE_A] ______________________________________________________________________
config = '[build-system]\nrequires = [ "whey",]\nbuild-backend = "whey"\n\n[project]\nname = "whey"\nversion = "2021.0.0"\ndesc....builders]\nwheel = "whey_pth_wheel"\n\n[tool.whey-pth]\nname = "my_project.pth"\npth-content = "import _virtualenv"\n'
tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_A0')
advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f0fd57f0940>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x7f0fd5918c10>, capsys = <_pytest.capture.CaptureFixture object at 0x7f0fd5918eb0>
@pytest.mark.parametrize(
"config",
[
pytest.param(WHEY_NO_PTH, id="WHEY_NO_PTH"),
pytest.param(COMPLETE_A, id="COMPLETE_A"),
pytest.param(COMPLETE_B, id="COMPLETE_B"),
]
)
def test_build_complete(
config: str,
tmp_pathplus: PathPlus,
advanced_data_regression: AdvancedDataRegressionFixture,
file_regression: FileRegressionFixture,
capsys,
):
(tmp_pathplus / "pyproject.toml").write_clean(config)
(tmp_pathplus / "whey").mkdir()
(tmp_pathplus / "whey" / "__init__.py").write_clean("print('hello world)")
(tmp_pathplus / "README.rst").write_clean("Spam Spam Spam Spam")
(tmp_pathplus / "LICENSE").write_clean("This is the license")
(tmp_pathplus / "requirements.txt").write_clean("domdf_python_tools")
data = {}
with tempfile.TemporaryDirectory() as tmpdir:
wheel_builder = PthWheelBuilder(
project_dir=tmp_pathplus,
config=load_toml(tmp_pathplus / "pyproject.toml"),
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
wheel = wheel_builder.build_wheel()
assert (tmp_pathplus / wheel).is_file()
zip_file = zipfile.ZipFile(tmp_pathplus / wheel)
data["wheel_content"] = sorted(zip_file.namelist())
with zip_file.open("whey/__init__.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with zip_file.open("whey-2021.0.0.dist-info/METADATA", mode='r') as fp:
check_file_regression(fp.read().decode("UTF-8"), file_regression)
if config != WHEY_NO_PTH:
with zip_file.open("my_project.pth", mode='r') as fp:
assert fp.read().decode("UTF-8") == "import _virtualenv\n"
with tempfile.TemporaryDirectory() as tmpdir:
sdist_builder = SDistBuilder(
project_dir=tmp_pathplus,
config=load_toml(tmp_pathplus / "pyproject.toml"),
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
sdist = sdist_builder.build_sdist()
assert (tmp_pathplus / sdist).is_file()
tar = tarfile.open(tmp_pathplus / sdist)
data["sdist_content"] = sorted(tar.getnames())
with tar.extractfile("whey-2021.0.0/whey/__init__.py") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with tar.extractfile("whey-2021.0.0/README.rst") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "Spam Spam Spam Spam\n"
with tar.extractfile("whey-2021.0.0/LICENSE") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "This is the license\n"
with tar.extractfile("whey-2021.0.0/requirements.txt") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "domdf_python_tools\n"
outerr = capsys.readouterr()
data["stdout"] = outerr.out.replace(tmp_pathplus.as_posix(), "...")
data["stderr"] = outerr.err
> advanced_data_regression.check(data)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_A0/test_whey_pth_/test_build_complete_COMPLETE_A_.yml
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_A0/test_whey_pth_/test_build_complete_COMPLETE_A_.obtained.yml
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_A0/test_whey_pth_/test_build_complete_COMPLETE_A_.obtained.diff.html
E ---
E +++
E @@ -15,8 +15,6 @@
E Writing whey-2021.0.0.dist-info/METADATA
E
E Writing whey-2021.0.0.dist-info/WHEEL
E -
E - Writing whey-2021.0.0.dist-info/top_level.txt
E
E Writing my_project.pth
E
E @@ -46,5 +44,4 @@
E - whey-2021.0.0.dist-info/RECORD
E - whey-2021.0.0.dist-info/WHEEL
E - whey-2021.0.0.dist-info/entry_points.txt
E -- whey-2021.0.0.dist-info/top_level.txt
E - whey/__init__.py
tests/test_whey_pth.py:232: AssertionError
_____________________________________________________________________ test_build_complete[COMPLETE_B] ______________________________________________________________________
config = '[build-system]\nrequires = [ "whey",]\nbuild-backend = "whey"\n\n[project]\nname = "whey"\nversion = "2021.0.0"\ndesc...whey.builders]\nwheel = "whey_pth_wheel"\n\n[tool.whey-pth]\nname = "my_project"\npth-content = "import _virtualenv"\n'
tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_B0')
advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f0fd575a0a0>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x7f0fd575a340>, capsys = <_pytest.capture.CaptureFixture object at 0x7f0fd575a4c0>
@pytest.mark.parametrize(
"config",
[
pytest.param(WHEY_NO_PTH, id="WHEY_NO_PTH"),
pytest.param(COMPLETE_A, id="COMPLETE_A"),
pytest.param(COMPLETE_B, id="COMPLETE_B"),
]
)
def test_build_complete(
config: str,
tmp_pathplus: PathPlus,
advanced_data_regression: AdvancedDataRegressionFixture,
file_regression: FileRegressionFixture,
capsys,
):
(tmp_pathplus / "pyproject.toml").write_clean(config)
(tmp_pathplus / "whey").mkdir()
(tmp_pathplus / "whey" / "__init__.py").write_clean("print('hello world)")
(tmp_pathplus / "README.rst").write_clean("Spam Spam Spam Spam")
(tmp_pathplus / "LICENSE").write_clean("This is the license")
(tmp_pathplus / "requirements.txt").write_clean("domdf_python_tools")
data = {}
with tempfile.TemporaryDirectory() as tmpdir:
wheel_builder = PthWheelBuilder(
project_dir=tmp_pathplus,
config=load_toml(tmp_pathplus / "pyproject.toml"),
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
wheel = wheel_builder.build_wheel()
assert (tmp_pathplus / wheel).is_file()
zip_file = zipfile.ZipFile(tmp_pathplus / wheel)
data["wheel_content"] = sorted(zip_file.namelist())
with zip_file.open("whey/__init__.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with zip_file.open("whey-2021.0.0.dist-info/METADATA", mode='r') as fp:
check_file_regression(fp.read().decode("UTF-8"), file_regression)
if config != WHEY_NO_PTH:
with zip_file.open("my_project.pth", mode='r') as fp:
assert fp.read().decode("UTF-8") == "import _virtualenv\n"
with tempfile.TemporaryDirectory() as tmpdir:
sdist_builder = SDistBuilder(
project_dir=tmp_pathplus,
config=load_toml(tmp_pathplus / "pyproject.toml"),
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
sdist = sdist_builder.build_sdist()
assert (tmp_pathplus / sdist).is_file()
tar = tarfile.open(tmp_pathplus / sdist)
data["sdist_content"] = sorted(tar.getnames())
with tar.extractfile("whey-2021.0.0/whey/__init__.py") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with tar.extractfile("whey-2021.0.0/README.rst") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "Spam Spam Spam Spam\n"
with tar.extractfile("whey-2021.0.0/LICENSE") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "This is the license\n"
with tar.extractfile("whey-2021.0.0/requirements.txt") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "domdf_python_tools\n"
outerr = capsys.readouterr()
data["stdout"] = outerr.out.replace(tmp_pathplus.as_posix(), "...")
data["stderr"] = outerr.err
> advanced_data_regression.check(data)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_B0/test_whey_pth_/test_build_complete_COMPLETE_B_.yml
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_B0/test_whey_pth_/test_build_complete_COMPLETE_B_.obtained.yml
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_COMPLETE_B0/test_whey_pth_/test_build_complete_COMPLETE_B_.obtained.diff.html
E ---
E +++
E @@ -15,8 +15,6 @@
E Writing whey-2021.0.0.dist-info/METADATA
E
E Writing whey-2021.0.0.dist-info/WHEEL
E -
E - Writing whey-2021.0.0.dist-info/top_level.txt
E
E Writing my_project.pth
E
E @@ -46,5 +44,4 @@
E - whey-2021.0.0.dist-info/RECORD
E - whey-2021.0.0.dist-info/WHEEL
E - whey-2021.0.0.dist-info/entry_points.txt
E -- whey-2021.0.0.dist-info/top_level.txt
E - whey/__init__.py
tests/test_whey_pth.py:232: AssertionError
_________________________________________________________________ test_build_complete_foreman[WHEY_NO_PTH] _________________________________________________________________
config = '[build-system]\nrequires = [ "whey",]\nbuild-backend = "whey"\n\n[project]\nname = "whey"\nversion = "2021.0.0"\ndesc...\nplatforms = [ "Windows", "macOS", "Linux",]\nlicense-key = "MIT"\n\n[tool.whey.builders]\nwheel = "whey_pth_wheel"\n'
tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_WH0')
advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f0fd575d190>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x7f0fd575dbe0>, capsys = <_pytest.capture.CaptureFixture object at 0x7f0fd575dd00>
@pytest.mark.parametrize(
"config",
[
pytest.param(WHEY_NO_PTH, id="WHEY_NO_PTH"),
pytest.param(COMPLETE_A, id="COMPLETE_A"),
pytest.param(COMPLETE_B, id="COMPLETE_B"),
]
)
def test_build_complete_foreman(
config: str,
tmp_pathplus: PathPlus,
advanced_data_regression: AdvancedDataRegressionFixture,
file_regression: FileRegressionFixture,
capsys,
):
(tmp_pathplus / "pyproject.toml").write_clean(config)
(tmp_pathplus / "whey").mkdir()
(tmp_pathplus / "whey" / "__init__.py").write_clean("print('hello world)")
(tmp_pathplus / "README.rst").write_clean("Spam Spam Spam Spam")
(tmp_pathplus / "LICENSE").write_clean("This is the license")
(tmp_pathplus / "requirements.txt").write_clean("domdf_python_tools")
data = {}
foreman = Foreman(project_dir=tmp_pathplus)
with tempfile.TemporaryDirectory() as tmpdir:
wheel = foreman.build_wheel(
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
assert (tmp_pathplus / wheel).is_file()
zip_file = zipfile.ZipFile(tmp_pathplus / wheel)
data["wheel_content"] = sorted(zip_file.namelist())
with zip_file.open("whey/__init__.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with zip_file.open("whey-2021.0.0.dist-info/METADATA", mode='r') as fp:
check_file_regression(fp.read().decode("UTF-8"), file_regression)
if config != WHEY_NO_PTH:
with zip_file.open("my_project.pth", mode='r') as fp:
assert fp.read().decode("UTF-8") == "import _virtualenv\n"
with tempfile.TemporaryDirectory() as tmpdir:
sdist = foreman.build_sdist(
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
assert (tmp_pathplus / sdist).is_file()
tar = tarfile.open(tmp_pathplus / sdist)
data["sdist_content"] = sorted(tar.getnames())
with tar.extractfile("whey-2021.0.0/whey/__init__.py") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with tar.extractfile("whey-2021.0.0/README.rst") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "Spam Spam Spam Spam\n"
with tar.extractfile("whey-2021.0.0/LICENSE") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "This is the license\n"
with tar.extractfile("whey-2021.0.0/requirements.txt") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "domdf_python_tools\n"
outerr = capsys.readouterr()
data["stdout"] = outerr.out.replace(tmp_pathplus.as_posix(), "...")
data["stderr"] = outerr.err
> advanced_data_regression.check(data)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_WH0/test_whey_pth_/test_build_complete_foreman_WHEY_NO_PTH_.yml
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_WH0/test_whey_pth_/test_build_complete_foreman_WHEY_NO_PTH_.obtained.yml
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_WH0/test_whey_pth_/test_build_complete_foreman_WHEY_NO_PTH_.obtained.diff.html
E ---
E +++
E @@ -15,8 +15,6 @@
E Writing whey-2021.0.0.dist-info/METADATA
E
E Writing whey-2021.0.0.dist-info/WHEEL
E -
E - Writing whey-2021.0.0.dist-info/top_level.txt
E
E Writing whey-2021.0.0.dist-info/RECORD
E
E @@ -43,5 +41,4 @@
E - whey-2021.0.0.dist-info/RECORD
E - whey-2021.0.0.dist-info/WHEEL
E - whey-2021.0.0.dist-info/entry_points.txt
E -- whey-2021.0.0.dist-info/top_level.txt
E - whey/__init__.py
tests/test_whey_pth.py:308: AssertionError
_________________________________________________________________ test_build_complete_foreman[COMPLETE_A] __________________________________________________________________
config = '[build-system]\nrequires = [ "whey",]\nbuild-backend = "whey"\n\n[project]\nname = "whey"\nversion = "2021.0.0"\ndesc....builders]\nwheel = "whey_pth_wheel"\n\n[tool.whey-pth]\nname = "my_project.pth"\npth-content = "import _virtualenv"\n'
tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO0')
advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f0fd580fe80>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x7f0fd580f580>, capsys = <_pytest.capture.CaptureFixture object at 0x7f0fd567b970>
@pytest.mark.parametrize(
"config",
[
pytest.param(WHEY_NO_PTH, id="WHEY_NO_PTH"),
pytest.param(COMPLETE_A, id="COMPLETE_A"),
pytest.param(COMPLETE_B, id="COMPLETE_B"),
]
)
def test_build_complete_foreman(
config: str,
tmp_pathplus: PathPlus,
advanced_data_regression: AdvancedDataRegressionFixture,
file_regression: FileRegressionFixture,
capsys,
):
(tmp_pathplus / "pyproject.toml").write_clean(config)
(tmp_pathplus / "whey").mkdir()
(tmp_pathplus / "whey" / "__init__.py").write_clean("print('hello world)")
(tmp_pathplus / "README.rst").write_clean("Spam Spam Spam Spam")
(tmp_pathplus / "LICENSE").write_clean("This is the license")
(tmp_pathplus / "requirements.txt").write_clean("domdf_python_tools")
data = {}
foreman = Foreman(project_dir=tmp_pathplus)
with tempfile.TemporaryDirectory() as tmpdir:
wheel = foreman.build_wheel(
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
assert (tmp_pathplus / wheel).is_file()
zip_file = zipfile.ZipFile(tmp_pathplus / wheel)
data["wheel_content"] = sorted(zip_file.namelist())
with zip_file.open("whey/__init__.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with zip_file.open("whey-2021.0.0.dist-info/METADATA", mode='r') as fp:
check_file_regression(fp.read().decode("UTF-8"), file_regression)
if config != WHEY_NO_PTH:
with zip_file.open("my_project.pth", mode='r') as fp:
assert fp.read().decode("UTF-8") == "import _virtualenv\n"
with tempfile.TemporaryDirectory() as tmpdir:
sdist = foreman.build_sdist(
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
assert (tmp_pathplus / sdist).is_file()
tar = tarfile.open(tmp_pathplus / sdist)
data["sdist_content"] = sorted(tar.getnames())
with tar.extractfile("whey-2021.0.0/whey/__init__.py") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with tar.extractfile("whey-2021.0.0/README.rst") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "Spam Spam Spam Spam\n"
with tar.extractfile("whey-2021.0.0/LICENSE") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "This is the license\n"
with tar.extractfile("whey-2021.0.0/requirements.txt") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "domdf_python_tools\n"
outerr = capsys.readouterr()
data["stdout"] = outerr.out.replace(tmp_pathplus.as_posix(), "...")
data["stderr"] = outerr.err
> advanced_data_regression.check(data)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO0/test_whey_pth_/test_build_complete_foreman_COMPLETE_A_.yml
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO0/test_whey_pth_/test_build_complete_foreman_COMPLETE_A_.obtained.yml
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO0/test_whey_pth_/test_build_complete_foreman_COMPLETE_A_.obtained.diff.html
E ---
E +++
E @@ -15,8 +15,6 @@
E Writing whey-2021.0.0.dist-info/METADATA
E
E Writing whey-2021.0.0.dist-info/WHEEL
E -
E - Writing whey-2021.0.0.dist-info/top_level.txt
E
E Writing my_project.pth
E
E @@ -46,5 +44,4 @@
E - whey-2021.0.0.dist-info/RECORD
E - whey-2021.0.0.dist-info/WHEEL
E - whey-2021.0.0.dist-info/entry_points.txt
E -- whey-2021.0.0.dist-info/top_level.txt
E - whey/__init__.py
tests/test_whey_pth.py:308: AssertionError
_________________________________________________________________ test_build_complete_foreman[COMPLETE_B] __________________________________________________________________
config = '[build-system]\nrequires = [ "whey",]\nbuild-backend = "whey"\n\n[project]\nname = "whey"\nversion = "2021.0.0"\ndesc...whey.builders]\nwheel = "whey_pth_wheel"\n\n[tool.whey-pth]\nname = "my_project"\npth-content = "import _virtualenv"\n'
tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO1')
advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f0fd5694dc0>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x7f0fd5694700>, capsys = <_pytest.capture.CaptureFixture object at 0x7f0fd56941c0>
@pytest.mark.parametrize(
"config",
[
pytest.param(WHEY_NO_PTH, id="WHEY_NO_PTH"),
pytest.param(COMPLETE_A, id="COMPLETE_A"),
pytest.param(COMPLETE_B, id="COMPLETE_B"),
]
)
def test_build_complete_foreman(
config: str,
tmp_pathplus: PathPlus,
advanced_data_regression: AdvancedDataRegressionFixture,
file_regression: FileRegressionFixture,
capsys,
):
(tmp_pathplus / "pyproject.toml").write_clean(config)
(tmp_pathplus / "whey").mkdir()
(tmp_pathplus / "whey" / "__init__.py").write_clean("print('hello world)")
(tmp_pathplus / "README.rst").write_clean("Spam Spam Spam Spam")
(tmp_pathplus / "LICENSE").write_clean("This is the license")
(tmp_pathplus / "requirements.txt").write_clean("domdf_python_tools")
data = {}
foreman = Foreman(project_dir=tmp_pathplus)
with tempfile.TemporaryDirectory() as tmpdir:
wheel = foreman.build_wheel(
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
assert (tmp_pathplus / wheel).is_file()
zip_file = zipfile.ZipFile(tmp_pathplus / wheel)
data["wheel_content"] = sorted(zip_file.namelist())
with zip_file.open("whey/__init__.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with zip_file.open("whey-2021.0.0.dist-info/METADATA", mode='r') as fp:
check_file_regression(fp.read().decode("UTF-8"), file_regression)
if config != WHEY_NO_PTH:
with zip_file.open("my_project.pth", mode='r') as fp:
assert fp.read().decode("UTF-8") == "import _virtualenv\n"
with tempfile.TemporaryDirectory() as tmpdir:
sdist = foreman.build_sdist(
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
assert (tmp_pathplus / sdist).is_file()
tar = tarfile.open(tmp_pathplus / sdist)
data["sdist_content"] = sorted(tar.getnames())
with tar.extractfile("whey-2021.0.0/whey/__init__.py") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with tar.extractfile("whey-2021.0.0/README.rst") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "Spam Spam Spam Spam\n"
with tar.extractfile("whey-2021.0.0/LICENSE") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "This is the license\n"
with tar.extractfile("whey-2021.0.0/requirements.txt") as fp: # type: ignore
assert fp.read().decode("UTF-8") == "domdf_python_tools\n"
outerr = capsys.readouterr()
data["stdout"] = outerr.out.replace(tmp_pathplus.as_posix(), "...")
data["stderr"] = outerr.err
> advanced_data_regression.check(data)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO1/test_whey_pth_/test_build_complete_foreman_COMPLETE_B_.yml
E /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO1/test_whey_pth_/test_build_complete_foreman_COMPLETE_B_.obtained.yml
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-50/test_build_complete_foreman_CO1/test_whey_pth_/test_build_complete_foreman_COMPLETE_B_.obtained.diff.html
E ---
E +++
E @@ -15,8 +15,6 @@
E Writing whey-2021.0.0.dist-info/METADATA
E
E Writing whey-2021.0.0.dist-info/WHEEL
E -
E - Writing whey-2021.0.0.dist-info/top_level.txt
E
E Writing my_project.pth
E
E @@ -46,5 +44,4 @@
E - whey-2021.0.0.dist-info/RECORD
E - whey-2021.0.0.dist-info/WHEEL
E - whey-2021.0.0.dist-info/entry_points.txt
E -- whey-2021.0.0.dist-info/top_level.txt
E - whey/__init__.py
tests/test_whey_pth.py:308: AssertionError
_______________________________________________________________________ test_build_additional_files ________________________________________________________________________
tmp_pathplus = PosixPathPlus('/tmp/pytest-of-tkloczko/pytest-50/test_build_additional_files0')
advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f0fd56ae730>
file_regression = <pytest_regressions.file_regression.FileRegressionFixture object at 0x7f0fd56ae820>, capsys = <_pytest.capture.CaptureFixture object at 0x7f0fd56ae8e0>
def test_build_additional_files(
tmp_pathplus: PathPlus,
advanced_data_regression: AdvancedDataRegressionFixture,
file_regression: FileRegressionFixture,
capsys,
):
(tmp_pathplus / "pyproject.toml").write_lines([
COMPLETE_A,
'',
"additional-wheel-files = [",
' "include _virtualenv.py",',
']',
])
(tmp_pathplus / "whey").mkdir()
(tmp_pathplus / "whey" / "__init__.py").write_clean("print('hello world)")
(tmp_pathplus / "_virtualenv.py").write_clean("This is the _virtualenv.py file")
(tmp_pathplus / "README.rst").write_clean("Spam Spam Spam Spam")
(tmp_pathplus / "LICENSE").write_clean("This is the license")
(tmp_pathplus / "requirements.txt").write_clean("domdf_python_tools")
data = {}
with tempfile.TemporaryDirectory() as tmpdir:
wheel_builder = PthWheelBuilder(
project_dir=tmp_pathplus,
config=load_toml(tmp_pathplus / "pyproject.toml"),
build_dir=tmpdir,
out_dir=tmp_pathplus,
verbose=True,
colour=False,
)
wheel = wheel_builder.build_wheel()
assert (tmp_pathplus / wheel).is_file()
zip_file = zipfile.ZipFile(tmp_pathplus / wheel)
data["wheel_content"] = sorted(zip_file.namelist())
with zip_file.open("whey/__init__.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "print('hello world)\n"
with zip_file.open("whey-2021.0.0.dist-info/METADATA", mode='r') as fp:
check_file_regression(fp.read().decode("UTF-8"), file_regression)
with zip_file.open("my_project.pth", mode='r') as fp:
assert fp.read().decode("UTF-8") == "import _virtualenv\n"
with zip_file.open("_virtualenv.py", mode='r') as fp:
assert fp.read().decode("UTF-8") == "This is the _virtualenv.py file\n"
outerr = capsys.readouterr()
data["stdout"] = outerr.out.replace(tmp_pathplus.as_posix(), "...")
data["stderr"] = outerr.err
> advanced_data_regression.check(data)
E AssertionError: FILES DIFFER:
E /tmp/pytest-of-tkloczko/pytest-50/test_build_additional_files0/test_whey_pth_/test_build_additional_files.yml
E /tmp/pytest-of-tkloczko/pytest-50/test_build_additional_files0/test_whey_pth_/test_build_additional_files.obtained.yml
E HTML DIFF: /tmp/pytest-of-tkloczko/pytest-50/test_build_additional_files0/test_whey_pth_/test_build_additional_files.obtained.diff.html
E ---
E +++
E @@ -8,8 +8,6 @@
E Writing whey-2021.0.0.dist-info/METADATA
E
E Writing whey-2021.0.0.dist-info/WHEEL
E -
E - Writing whey-2021.0.0.dist-info/top_level.txt
E
E Writing my_project.pth
E
E @@ -28,5 +26,4 @@
E - whey-2021.0.0.dist-info/RECORD
E - whey-2021.0.0.dist-info/WHEEL
E - whey-2021.0.0.dist-info/entry_points.txt
E -- whey-2021.0.0.dist-info/top_level.txt
E - whey/__init__.py
tests/test_whey_pth.py:364: AssertionError
=========================================================================== slowest 25 durations ===========================================================================
0.06s call tests/test_whey_pth.py::test_build_complete[WHEY_NO_PTH]
0.04s call tests/test_whey_pth.py::test_build_complete[COMPLETE_A]
0.04s call tests/test_whey_pth.py::test_build_complete[COMPLETE_B]
0.03s call tests/test_whey_pth.py::test_build_complete_foreman[COMPLETE_B]
0.03s call tests/test_whey_pth.py::test_build_complete_foreman[COMPLETE_A]
0.03s call tests/test_whey_pth.py::test_build_complete_foreman[WHEY_NO_PTH]
0.02s call tests/test_whey_pth.py::test_build_additional_files
(18 durations < 0.005s hidden. Use -vv to show these durations.)
========================================================================= short test summary info ==========================================================================
FAILED tests/test_whey_pth.py::test_build_complete[WHEY_NO_PTH] - AssertionError: FILES DIFFER:
FAILED tests/test_whey_pth.py::test_build_complete[COMPLETE_A] - AssertionError: FILES DIFFER:
FAILED tests/test_whey_pth.py::test_build_complete[COMPLETE_B] - AssertionError: FILES DIFFER:
FAILED tests/test_whey_pth.py::test_build_complete_foreman[WHEY_NO_PTH] - AssertionError: FILES DIFFER:
FAILED tests/test_whey_pth.py::test_build_complete_foreman[COMPLETE_A] - AssertionError: FILES DIFFER:
FAILED tests/test_whey_pth.py::test_build_complete_foreman[COMPLETE_B] - AssertionError: FILES DIFFER:
FAILED tests/test_whey_pth.py::test_build_additional_files - AssertionError: FILES DIFFER:
======================================================================= 7 failed, 2 passed in 0.69s ========================================================================