Skip to content

Commit 3fdea92

Browse files
Apply ruff/flake8-pytest-style rule PT001
PT001 Use `@pytest.fixture` over `@pytest.fixture()`
1 parent 2b25dff commit 3fdea92

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

testing/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ def debug_mode() -> Iterator[DebugMode]:
7979
yield debug_mode
8080

8181

82-
@pytest.fixture()
82+
@pytest.fixture
8383
def wd(tmp_path: Path) -> WorkDir:
8484
target_wd = tmp_path.resolve() / "wd"
8585
target_wd.mkdir()
8686
return WorkDir(target_wd)
8787

8888

89-
@pytest.fixture()
89+
@pytest.fixture
9090
def repositories_hg_git(tmp_path: Path) -> tuple[WorkDir, WorkDir]:
9191
tmp_path = tmp_path.resolve()
9292
path_git = tmp_path / "repo_git"

testing/test_git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def test_git_worktree_support(wd: WorkDir, tmp_path: Path) -> None:
307307
assert str(worktree) in res.stdout
308308

309309

310-
@pytest.fixture()
310+
@pytest.fixture
311311
def shallow_wd(wd: WorkDir, tmp_path: Path) -> Path:
312312
wd.commit_testfile()
313313
wd.commit_testfile()
@@ -515,7 +515,7 @@ def test_git_getdate_git_2_45_0_plus(
515515
assert git_wd.get_head_date() == date(2024, 4, 30)
516516

517517

518-
@pytest.fixture()
518+
@pytest.fixture
519519
def signed_commit_wd(monkeypatch: pytest.MonkeyPatch, wd: WorkDir) -> WorkDir:
520520
if not has_command("gpg", args=["--version"], warn=False):
521521
pytest.skip("gpg executable not found")

testing/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
c = Configuration()
2424

2525

26-
@pytest.fixture()
26+
@pytest.fixture
2727
def wd(wd: WorkDir) -> WorkDir:
2828
wd("git init")
2929
wd("git config user.email [email protected]")

testing/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_main() -> None:
2020
exec(code, ns)
2121

2222

23-
@pytest.fixture()
23+
@pytest.fixture
2424
def repo(wd: WorkDir) -> WorkDir:
2525
wd("git init")
2626
wd("git config user.email user@host")

testing/test_mercurial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222

2323

24-
@pytest.fixture()
24+
@pytest.fixture
2525
def wd(wd: WorkDir) -> WorkDir:
2626
wd("hg init")
2727
wd.add_command = "hg add ."
@@ -153,15 +153,15 @@ def test_parse_no_worktree(tmp_path: Path) -> None:
153153
assert ret is None
154154

155155

156-
@pytest.fixture()
156+
@pytest.fixture
157157
def version_1_0(wd: WorkDir) -> WorkDir:
158158
wd("hg branch default")
159159
wd.commit_testfile()
160160
wd('hg tag 1.0.0 -u test -d "0 0"')
161161
return wd
162162

163163

164-
@pytest.fixture()
164+
@pytest.fixture
165165
def pre_merge_commit_after_tag(version_1_0: WorkDir) -> WorkDir:
166166
wd = version_1_0
167167
wd("hg branch testbranch")

0 commit comments

Comments
 (0)