Skip to content

Commit cede9b6

Browse files
committed
chore: run ruff
1 parent 72be3e4 commit cede9b6

14 files changed

+24
-10
lines changed

tests/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from .utils import ExpectEvent, Helper, P, StartWatching, TestEventQueue
1212

1313

14-
@pytest.fixture()
14+
@pytest.fixture
1515
def p(tmpdir, *args):
1616
"""
1717
Convenience function to join the temporary directory path

tests/test_0_watchmedo.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
# in README.rst
1313
yaml = pytest.importorskip("yaml")
1414

15+
from yaml.constructor import ConstructorError # noqa: E402
16+
from yaml.scanner import ScannerError # noqa: E402
17+
1518
from watchdog import watchmedo # noqa: E402
1619
from watchdog.events import FileModifiedEvent, FileOpenedEvent # noqa: E402
1720
from watchdog.tricks import AutoRestartTrick, ShellCommandTrick # noqa: E402
1821
from watchdog.utils import WatchdogShutdownError, platform # noqa: E402
19-
from yaml.constructor import ConstructorError # noqa: E402
20-
from yaml.scanner import ScannerError # noqa: E402
2122

2223

2324
def test_load_config_valid(tmpdir):

tests/test_delayed_queue.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from time import time
44

55
import pytest
6+
67
from watchdog.utils.delayed_queue import DelayedQueue
78

89

tests/test_echo.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Any
22

33
import pytest
4+
45
from watchdog.utils import echo
56

67

tests/test_emitter.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import TYPE_CHECKING
99

1010
import pytest
11+
1112
from watchdog.events import (
1213
DirCreatedEvent,
1314
DirDeletedEvent,

tests/test_fsevents.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import contextlib
44

55
import pytest
6+
67
from watchdog.utils import platform
78

89
if not platform.is_darwin():
@@ -19,6 +20,7 @@
1920
from unittest.mock import patch
2021

2122
import _watchdog_fsevents as _fsevents # type: ignore[import-not-found]
23+
2224
from watchdog.events import FileSystemEventHandler
2325
from watchdog.observers import Observer
2426
from watchdog.observers.api import BaseObserver, ObservedWatch
@@ -33,7 +35,7 @@
3335
logger = logging.getLogger(__name__)
3436

3537

36-
@pytest.fixture()
38+
@pytest.fixture
3739
def observer():
3840
obs = Observer()
3941
obs.start()

tests/test_inotify_buffer.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import pytest
4+
45
from watchdog.utils import platform
56

67
if not platform.is_linux():

tests/test_inotify_c.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import pytest
4+
45
from watchdog.utils import platform
56

67
if not platform.is_linux():

tests/test_observer.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
from unittest.mock import patch
77

88
import pytest
9+
910
from watchdog.events import FileModifiedEvent, FileSystemEventHandler
1011
from watchdog.observers.api import BaseObserver, EventEmitter
1112

1213
if TYPE_CHECKING:
1314
from collections.abc import Iterator
1415

1516

16-
@pytest.fixture()
17+
@pytest.fixture
1718
def observer() -> Iterator[BaseObserver]:
1819
obs = BaseObserver(EventEmitter)
1920
yield obs
@@ -22,7 +23,7 @@ def observer() -> Iterator[BaseObserver]:
2223
obs.join()
2324

2425

25-
@pytest.fixture()
26+
@pytest.fixture
2627
def observer2():
2728
obs = BaseObserver(EventEmitter)
2829
yield obs

tests/test_observers_api.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from pathlib import Path
55

66
import pytest
7+
78
from watchdog.events import FileModifiedEvent, FileOpenedEvent, LoggingEventHandler
89
from watchdog.observers.api import BaseObserver, EventDispatcher, EventEmitter, EventQueue, ObservedWatch
910

tests/test_observers_polling.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from time import sleep
66

77
import pytest
8+
89
from watchdog.events import (
910
DirCreatedEvent,
1011
DirDeletedEvent,
@@ -32,12 +33,12 @@ def p(*args):
3233
return os.path.join(TEMP_DIR, *args)
3334

3435

35-
@pytest.fixture()
36+
@pytest.fixture
3637
def event_queue():
3738
return Queue()
3839

3940

40-
@pytest.fixture()
41+
@pytest.fixture
4142
def emitter(event_queue):
4243
watch = ObservedWatch(TEMP_DIR, recursive=True)
4344
em = Emitter(event_queue, watch, timeout=0.2)

tests/test_observers_winapi.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from time import sleep
77

88
import pytest
9+
910
from watchdog.events import DirCreatedEvent, DirMovedEvent
1011
from watchdog.observers.api import ObservedWatch
1112
from watchdog.utils import platform
@@ -33,12 +34,12 @@ def p(*args):
3334
return os.path.join(temp_dir, *args)
3435

3536

36-
@pytest.fixture()
37+
@pytest.fixture
3738
def event_queue():
3839
return Queue()
3940

4041

41-
@pytest.fixture()
42+
@pytest.fixture
4243
def emitter(event_queue):
4344
watch = ObservedWatch(temp_dir, recursive=True)
4445
em = WindowsApiEmitter(event_queue, watch, timeout=0.2)

tests/test_patterns.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import pytest
4+
45
from watchdog.utils.patterns import _match_path, filter_paths, match_any_paths
56

67

tests/test_skip_repeats_queue.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import pytest
4+
45
from watchdog import events
56
from watchdog.utils.bricks import SkipRepeatsQueue
67

0 commit comments

Comments
 (0)