more mypy fixes
This commit is contained in:
@@ -67,6 +67,7 @@ repos:
|
|||||||
- types-jinja2
|
- types-jinja2
|
||||||
- types-pyyaml
|
- types-pyyaml
|
||||||
- types-requests
|
- types-requests
|
||||||
|
- types-toml
|
||||||
- bracex
|
- bracex
|
||||||
- dataclasses
|
- dataclasses
|
||||||
- id: mypy
|
- id: mypy
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import subprocess
|
|||||||
import tempfile
|
import tempfile
|
||||||
import textwrap
|
import textwrap
|
||||||
from pathlib import Path, PurePath, PurePosixPath
|
from pathlib import Path, PurePath, PurePosixPath
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import toml
|
import toml
|
||||||
@@ -30,7 +29,7 @@ else:
|
|||||||
DEFAULT_IMAGE = ""
|
DEFAULT_IMAGE = ""
|
||||||
|
|
||||||
# These globals will be manipulated
|
# These globals will be manipulated
|
||||||
temp_test_dir: Optional[tempfile.TemporaryDirectory[str]] = None
|
temp_test_dir = None
|
||||||
using_podman = False
|
using_podman = False
|
||||||
|
|
||||||
|
|
||||||
@@ -56,7 +55,7 @@ def _cleanup_podman_vfs_tempdir():
|
|||||||
if temp_test_dir is not None:
|
if temp_test_dir is not None:
|
||||||
# When podman creates special directories, they can't be cleaned up
|
# When podman creates special directories, they can't be cleaned up
|
||||||
# unless you fake a UID of 0. The package rootlesskit helps with that.
|
# unless you fake a UID of 0. The package rootlesskit helps with that.
|
||||||
if using_podman:
|
if using_podman: # type: ignore[unreachable]
|
||||||
subprocess.call(["podman", "unshare", "rm", "-rf", temp_test_dir.name])
|
subprocess.call(["podman", "unshare", "rm", "-rf", temp_test_dir.name])
|
||||||
temp_test_dir = None
|
temp_test_dir = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user