summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorq0w <43147888+q0w@users.noreply.github.com>2022-12-25 07:43:15 +0300
committerGitHub <noreply@github.com>2022-12-25 04:43:15 +0000
commita36ff9dcf9457a56cf8e694b6dce40ac79566242 (patch)
tree32a51ef92a4ebe2eb9ab85e3e74608a608d06025 /tests
parentb0c3cf64916398ded8e86ba94dbf3c91b7d857d9 (diff)
downloadtox-git-a36ff9dcf9457a56cf8e694b6dce40ac79566242.tar.gz
Fix --sdistonly behaviour (#2775)
Diffstat (limited to 'tests')
-rw-r--r--tests/tox_env/test_tox_env_runner.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/tox_env/test_tox_env_runner.py b/tests/tox_env/test_tox_env_runner.py
new file mode 100644
index 00000000..f1b34a90
--- /dev/null
+++ b/tests/tox_env/test_tox_env_runner.py
@@ -0,0 +1,27 @@
+from pathlib import Path
+
+from tox.pytest import ToxProjectCreator
+
+
+def test_package_only(
+ tox_project: ToxProjectCreator,
+ demo_pkg_inline: Path,
+) -> None:
+ ini = "[testenv]\ncommands = python -c 'print('foo')'"
+ proj = tox_project(
+ {"tox.ini": ini, "pyproject.toml": (demo_pkg_inline / "pyproject.toml").read_text()},
+ base=demo_pkg_inline,
+ )
+ execute_calls = proj.patch_execute(lambda r: 0 if "install" in r.run_id else None)
+ result = proj.run("r", "--sdistonly")
+ result.assert_success()
+
+ expected_calls = [
+ (".pkg", "_optional_hooks"),
+ (".pkg", "get_requires_for_build_sdist"),
+ (".pkg", "build_wheel"),
+ (".pkg", "build_sdist"),
+ (".pkg", "_exit"),
+ ]
+ found_calls = [(i[0][0].conf.name, i[0][3].run_id) for i in execute_calls.call_args_list]
+ assert found_calls == expected_calls