Skip to content

Commit 932eaf0

Browse files
committed
formatting
1 parent bb4e169 commit 932eaf0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/validators/url.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl Validator for UrlValidator {
103103
// given that we want isinstance to work properly for subclasses of Url
104104
let py_url = match either_url {
105105
EitherUrl::Py(py_url) => py_url.get().clone(),
106-
EitherUrl::Rust(rust_url) => PyUrl::new(rust_url)
106+
EitherUrl::Rust(rust_url) => PyUrl::new(rust_url),
107107
};
108108

109109
let py_url = PyUrl::build(
@@ -294,14 +294,14 @@ impl Validator for MultiHostUrlValidator {
294294
// given that we want isinstance to work properly for subclasses of Url
295295
let py_url = match multi_url {
296296
EitherMultiHostUrl::Py(py_url) => py_url.get().clone(),
297-
EitherMultiHostUrl::Rust(rust_url) => rust_url
297+
EitherMultiHostUrl::Rust(rust_url) => rust_url,
298298
};
299299

300300
let hosts = py_url.hosts(py).map_or(None, |hosts| {
301301
let mut host_parts_vec = Vec::new();
302-
for host in hosts.iter() {
302+
for host in &hosts {
303303
if let Ok(py_dict) = host.downcast::<PyDict>() {
304-
if let Some(host_parts) = UrlHostParts::extract_bound(py_dict).ok() {
304+
if let Ok(host_parts) = UrlHostParts::extract_bound(py_dict) {
305305
host_parts_vec.push(host_parts);
306306
}
307307
}
@@ -319,7 +319,7 @@ impl Validator for MultiHostUrlValidator {
319319
None,
320320
None,
321321
None,
322-
None
322+
None,
323323
)?;
324324
Ok(py_url.into_py(py))
325325
} else {

tests/test_errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def multi_raise_py_error(v: Any) -> Any:
551551
s2.validate_python('anything')
552552

553553
cause_group = exc_info.value.__cause__
554-
assert isinstance(cause_group, BaseExceptionGroup)
554+
assert isinstance(cause_group, BaseExceptionGroup) # noqa: F821
555555
assert len(cause_group.exceptions) == 1
556556

557557
cause = cause_group.exceptions[0]
@@ -576,7 +576,7 @@ def outer_raise_py_error(v: Any) -> Any:
576576
with pytest.raises(ValidationError) as exc_info:
577577
s3.validate_python('anything')
578578

579-
assert isinstance(exc_info.value.__cause__, BaseExceptionGroup)
579+
assert isinstance(exc_info.value.__cause__, BaseExceptionGroup) # noqa: F821
580580
assert len(exc_info.value.__cause__.exceptions) == 1
581581
cause = exc_info.value.__cause__.exceptions[0]
582582
assert cause.__notes__ and cause.__notes__[-1].startswith('\nPydantic: ')
@@ -585,7 +585,7 @@ def outer_raise_py_error(v: Any) -> Any:
585585
assert isinstance(subcause, ValidationError)
586586

587587
cause_group = subcause.__cause__
588-
assert isinstance(cause_group, BaseExceptionGroup)
588+
assert isinstance(cause_group, BaseExceptionGroup) # noqa: F821
589589
assert len(cause_group.exceptions) == 1
590590

591591
cause = cause_group.exceptions[0]

0 commit comments

Comments
 (0)