Skip to content

Commit 18ba287

Browse files
committed
make ruff pass
1 parent c880f53 commit 18ba287

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

tests/modules/lint/test_patch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from pathlib import Path
2-
from typing import Union
32

43
import nf_core.modules.install
54
import nf_core.modules.lint
@@ -14,7 +13,7 @@
1413
class TestPatch(TestModules):
1514
"""Test patch.py functionality"""
1615

17-
def _setup_patch(self, pipeline_dir: Union[str, Path], modify_module: bool):
16+
def _setup_patch(self, pipeline_dir: str | Path, modify_module: bool):
1817
install_obj = nf_core.modules.install.ModuleInstall(
1918
pipeline_dir,
2019
prompt=False,

tests/pipelines/test_sync.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import json
44
import os
55
from pathlib import Path
6-
from typing import Union
76
from unittest import mock
87

98
import git
@@ -19,12 +18,12 @@
1918

2019

2120
class MockResponse:
22-
def __init__(self, data: Union[dict, list[dict]], status_code: int, url: str):
21+
def __init__(self, data: dict | list[dict], status_code: int, url: str):
2322
self.url: str = url
2423
self.status_code: int = status_code
2524
self.from_cache: bool = False
2625
self.reason: str = "Mocked response"
27-
self.data: Union[dict, list[dict]] = data
26+
self.data: dict | list[dict] = data
2827
self.content: str = json.dumps(data)
2928
self.headers: dict[str, str] = {"content-encoding": "test", "connection": "fake"}
3029

@@ -342,7 +341,7 @@ def test_close_open_pr(self, mock_patch, mock_post) -> None:
342341
psync.gh_username = "bad_url"
343342
psync.gh_repo = "bad_url/response"
344343
os.environ["GITHUB_AUTH_TOKEN"] = "test"
345-
pr: dict[str, Union[str, dict[str, str]]] = {
344+
pr: dict[str, str | dict[str, str]] = {
346345
"state": "open",
347346
"head": {"ref": "nf-core-template-merge-3"},
348347
"base": {"ref": "main"},

tests/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
import filecmp
66
import functools
77
import tempfile
8+
from collections.abc import Callable
89
from pathlib import Path
9-
from typing import Any, Callable
10+
from typing import Any
1011

1112
import responses
1213
import yaml

0 commit comments

Comments
 (0)