File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-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+ print (list ((cwd / ".tox" ).iterdir ()))
16+ assert (cwd / ".tox" / "CACHEDIR.TAG" ).exists ()
17+
18+
19+ def test_cachedir_tag_not_created_in_extant_workdir (tox_project : ToxProjectCreator , tmp_path ) -> None :
20+ workdir = tmp_path / "workworkwork"
21+ workdir .mkdir (parents = True )
22+ prj = tox_project ({"tox.ini" : "[testenv]\n commands=python --version" })
23+ result = prj .run ("--workdir" , str (workdir ), from_cwd = prj .path .parent )
24+ result .assert_success ()
25+ assert not (workdir / "CACHEDIR.TAG" ).exists ()
You can’t perform that action at this time.
0 commit comments