File: test_path.py

package info (click to toggle)
tox 4.33.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,096 kB
  • sloc: python: 19,473; sh: 22; makefile: 14
file content (16 lines) | stat: -rw-r--r-- 357 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from __future__ import annotations

from typing import TYPE_CHECKING

from tox.util.path import ensure_empty_dir

if TYPE_CHECKING:
    from pathlib import Path


def test_ensure_empty_dir_file(tmp_path: Path) -> None:
    dest = tmp_path / "a"
    dest.write_text("")
    ensure_empty_dir(dest)
    assert dest.is_dir()
    assert not list(dest.iterdir())