summaryrefslogtreecommitdiff
path: root/tests/session
diff options
context:
space:
mode:
authorBernát Gábor <bgabor8@bloomberg.net>2021-01-01 12:18:05 +0000
committerBernát Gábor <bgabor8@bloomberg.net>2021-01-01 12:18:05 +0000
commitfd915cc8481265da415b039f8464a2437737060c (patch)
tree17ae5ab2e034a3c79b491e87d83cc1182726e43d /tests/session
parent840aa2995a9319d3cc32073afe0f2b23f71dd0b9 (diff)
downloadtox-git-fd915cc8481265da415b039f8464a2437737060c.tar.gz
Allow changing the root folder and increase coverage
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
Diffstat (limited to 'tests/session')
-rw-r--r--tests/session/cmd/test_sequential.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/session/cmd/test_sequential.py b/tests/session/cmd/test_sequential.py
index f818b88e..f703e907 100644
--- a/tests/session/cmd/test_sequential.py
+++ b/tests/session/cmd/test_sequential.py
@@ -1,6 +1,7 @@
import json
import re
import sys
+from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
import pytest
@@ -111,3 +112,32 @@ def test_result_json_sequential(tox_project: ToxProjectCreator) -> None:
def get_cmd_exit_run_id(report: Dict[str, Any], name: str, group: str) -> List[Tuple[Union[int, None], str]]:
return [(i["retcode"], i["run_id"]) for i in report["testenvs"][name].pop(group)]
+
+
+def test_rerun_sequential_skip(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
+ proj = tox_project({"tox.ini": "[testenv]\npackage=skip\ncommands=python -c 'print(1)'"})
+ result_first = proj.run("--root", str(demo_pkg_inline))
+ result_first.assert_success()
+ result_rerun = proj.run("--root", str(demo_pkg_inline))
+ result_rerun.assert_success()
+
+
+def test_rerun_sequential_wheel(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
+ proj = tox_project(
+ {"tox.ini": "[testenv]\npackage=wheel\ncommands=python -c 'from demo_pkg_inline import do; do()'"}
+ )
+ result_first = proj.run("--root", str(demo_pkg_inline))
+ result_first.assert_success()
+ result_rerun = proj.run("--root", str(demo_pkg_inline))
+ result_rerun.assert_success()
+
+
+@pytest.mark.integration
+def test_rerun_sequential_sdist(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
+ proj = tox_project(
+ {"tox.ini": "[testenv]\npackage=sdist\ncommands=python -c 'from demo_pkg_inline import do; do()'"}
+ )
+ result_first = proj.run("--root", str(demo_pkg_inline))
+ result_first.assert_success()
+ result_rerun = proj.run("--root", str(demo_pkg_inline))
+ result_rerun.assert_success()