mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Bump Ruff to 0.9.0
This commit is contained in:
@@ -12,7 +12,7 @@ variable: myint
|
||||
variable2 = None # type: myint
|
||||
|
||||
#: docstring
|
||||
variable3: Optional[myint] # NoQA: UP007
|
||||
variable3: Optional[myint] # NoQA: UP045
|
||||
|
||||
|
||||
def read(r: io.BytesIO) -> io.StringIO:
|
||||
|
@@ -2,6 +2,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from sphinx.errors import ExtensionError
|
||||
@@ -24,16 +26,11 @@ def test_event_priority():
|
||||
assert result == [3, 1, 2, 5, 4]
|
||||
|
||||
|
||||
class FakeApp:
|
||||
def __init__(self, pdb: bool = False):
|
||||
self.pdb = pdb
|
||||
|
||||
|
||||
def test_event_allowed_exceptions():
|
||||
def raise_error(app):
|
||||
raise RuntimeError
|
||||
|
||||
app = FakeApp() # pass a dummy object as an app
|
||||
app = SimpleNamespace(pdb=False) # pass a dummy object as an app
|
||||
events = EventManager(app) # type: ignore[arg-type]
|
||||
events.connect('builder-inited', raise_error, priority=500)
|
||||
|
||||
@@ -50,7 +47,7 @@ def test_event_pdb():
|
||||
def raise_error(app):
|
||||
raise RuntimeError
|
||||
|
||||
app = FakeApp(pdb=True) # pass a dummy object as an app
|
||||
app = SimpleNamespace(pdb=True) # pass a dummy object as an app
|
||||
events = EventManager(app) # type: ignore[arg-type]
|
||||
events.connect('builder-inited', raise_error, priority=500)
|
||||
|
||||
|
@@ -96,7 +96,7 @@ def test_TypeAliasForwardRef():
|
||||
sig_str = stringify_annotation(alias, 'fully-qualified-except-typing')
|
||||
assert sig_str == "TypeAliasForwardRef('example')"
|
||||
|
||||
alias = Optional[alias] # NoQA: UP007
|
||||
alias = Optional[alias] # NoQA: UP045
|
||||
sig_str = stringify_annotation(alias, 'fully-qualified-except-typing')
|
||||
assert sig_str == "TypeAliasForwardRef('example') | None"
|
||||
|
||||
|
Reference in New Issue
Block a user