add PT
This commit is contained in:
@@ -19,7 +19,7 @@ def wayland_compositor() -> Generator[Popen, None, None]:
|
||||
GtkProc = NewType("GtkProc", Popen)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@pytest.fixture
|
||||
def app() -> Generator[GtkProc, None, None]:
|
||||
rapp = Popen([sys.executable, "-m", "clan_app"], text=True)
|
||||
yield GtkProc(rapp)
|
||||
|
||||
@@ -246,7 +246,7 @@ def test_flake_with_core(
|
||||
@pytest.fixture
|
||||
def test_local_democlan(
|
||||
monkeypatch: pytest.MonkeyPatch, temporary_home: Path
|
||||
) -> Iterator[FlakeForTest]:
|
||||
) -> FlakeForTest:
|
||||
democlan = os.getenv(key="DEMOCLAN_ROOT")
|
||||
if democlan is None:
|
||||
msg = (
|
||||
@@ -258,7 +258,7 @@ def test_local_democlan(
|
||||
msg = f"DEMOCLAN_ROOT ({democlan_p}) is not a directory. This test requires the democlan directory to be present"
|
||||
raise Exception(msg)
|
||||
|
||||
yield FlakeForTest(democlan_p)
|
||||
return FlakeForTest(democlan_p)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import types
|
||||
|
||||
import pytest
|
||||
from pytest import CaptureFixture
|
||||
|
||||
|
||||
class CaptureOutput:
|
||||
def __init__(self, capsys: CaptureFixture) -> None:
|
||||
def __init__(self, capsys: pytest.CaptureFixture) -> None:
|
||||
self.capsys = capsys
|
||||
self.capsys_disabled = capsys.disabled()
|
||||
self.capsys_disabled.__enter__()
|
||||
@@ -31,5 +30,5 @@ class CaptureOutput:
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def capture_output(capsys: CaptureFixture) -> CaptureOutput:
|
||||
def capture_output(capsys: pytest.CaptureFixture) -> CaptureOutput:
|
||||
return CaptureOutput(capsys)
|
||||
|
||||
@@ -143,7 +143,7 @@ def test_cast() -> None:
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"option,value,options,expected",
|
||||
("option", "value", "options", "expected"),
|
||||
[
|
||||
("foo.bar", ["baz"], {"foo.bar": {"type": "str"}}, ("foo.bar", ["baz"])),
|
||||
("foo.bar", ["baz"], {"foo": {"type": "attrs"}}, ("foo", {"bar": ["baz"]})),
|
||||
|
||||
@@ -28,10 +28,9 @@ def test_commit_file(git_repo: Path) -> None:
|
||||
def test_commit_file_outside_git_raises_error(git_repo: Path) -> None:
|
||||
# create a file outside the git (a temporary file)
|
||||
with tempfile.NamedTemporaryFile() as tmp:
|
||||
# commit the file
|
||||
with pytest.raises(ClanError):
|
||||
git.commit_file(Path(tmp.name), git_repo, "test commit")
|
||||
|
||||
# this should not fail but skip the commit
|
||||
with pytest.raises(ClanError):
|
||||
git.commit_file(Path(tmp.name), git_repo, "test commit")
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ def wayland_compositor() -> Generator[Popen, None, None]:
|
||||
GtkProc = NewType("GtkProc", Popen)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@pytest.fixture
|
||||
def app() -> Generator[GtkProc, None, None]:
|
||||
rapp = Popen([sys.executable, "-m", "clan_vm_manager"], text=True)
|
||||
yield GtkProc(rapp)
|
||||
|
||||
@@ -27,6 +27,7 @@ lint.select = [
|
||||
"LOG",
|
||||
"N",
|
||||
"PIE",
|
||||
"PT",
|
||||
"PYI",
|
||||
"RUF",
|
||||
"T10",
|
||||
|
||||
Reference in New Issue
Block a user