From 08e16dc355957ae1eff953e143fd6d1b3b4129bc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 04:14:48 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- _test/test_bools.py | 16 ++++++++-------- lib/ruyaml/main.py | 8 +++++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/_test/test_bools.py b/_test/test_bools.py index d6620b3..3ed4085 100644 --- a/_test/test_bools.py +++ b/_test/test_bools.py @@ -1,16 +1,17 @@ +import io +from typing import Any, Dict, List, Text # NOQA import pytest -import io -import ruyaml # NOQA -from .roundtrip import round_trip, dedent +import ruyaml # NOQA from ruyaml import YAML -from ruyaml.util import load_yaml_guess_indent -from ruyaml.scalarbool import ScalarBoolean from ruyaml.comments import CommentedSeq -from ruyaml.representer import RoundTripRepresenter, ScalarNode from ruyaml.constructor import RoundTripConstructor -from typing import Text, Any, Dict, List # NOQA +from ruyaml.representer import RoundTripRepresenter, ScalarNode +from ruyaml.scalarbool import ScalarBoolean +from ruyaml.util import load_yaml_guess_indent + +from .roundtrip import dedent, round_trip def round_trip_stabler( @@ -31,7 +32,6 @@ def round_trip_stabler( class TestStability: - def test_lowercase_boolean(self): round_trip( """ diff --git a/lib/ruyaml/main.py b/lib/ruyaml/main.py index fd0a4fb..7cf16a7 100644 --- a/lib/ruyaml/main.py +++ b/lib/ruyaml/main.py @@ -243,9 +243,11 @@ def constructor(self): # type: () -> Any attr = '_' + sys._getframe().f_code.co_name if not hasattr(self, attr): - cnst = self.Constructor(preserve_quotes=self.preserve_quotes, - preserve_bools=self.preserve_bools, - loader=self) + cnst = self.Constructor( + preserve_quotes=self.preserve_quotes, + preserve_bools=self.preserve_bools, + loader=self, + ) cnst.allow_duplicate_keys = self.allow_duplicate_keys setattr(self, attr, cnst) return getattr(self, attr)