File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ from typing import TYPE_CHECKING
4+
5+ if TYPE_CHECKING :
6+ from tox .pytest import ToxProjectCreator
7+
8+
9+ def test_cachedir_tag_created_in_new_workdir (tox_project : ToxProjectCreator ) -> None :
10+ prj = tox_project ({"tox.ini" : "[testenv]\n commands=python --version" })
11+ cwd = prj .path
12+ assert not (cwd / ".tox" ).exists ()
13+ result = prj .run ("run" , from_cwd = cwd )
14+ result .assert_success ()
15+ assert (cwd / ".tox" / "CACHEDIR.TAG" ).exists ()
16+
17+
18+ def test_cachedir_tag_not_created_in_extant_workdir (tox_project : ToxProjectCreator , tmp_path ) -> None :
19+ workdir = tmp_path / "workworkwork"
20+ workdir .mkdir (parents = True )
21+ prj = tox_project ({"tox.ini" : "[testenv]\n commands=python --version" })
22+ result = prj .run ("--workdir" , str (workdir ), from_cwd = prj .path .parent )
23+ result .assert_success ()
24+ assert not (workdir / "CACHEDIR.TAG" ).exists ()
You can’t perform that action at this time.
0 commit comments