From a7c1fe3bff5655393018c53b448b669b3525515b Mon Sep 17 00:00:00 2001 From: finnagin Date: Mon, 18 Jul 2022 12:20:56 -0700 Subject: [PATCH] Remove utc fixture from tests --- tests/unit/test_base_command.py | 2 +- tests/unit/test_logging.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/test_base_command.py b/tests/unit/test_base_command.py index c6944730ae1..71a50fca617 100644 --- a/tests/unit/test_base_command.py +++ b/tests/unit/test_base_command.py @@ -16,7 +16,7 @@ @pytest.fixture -def fixed_time(utc: None) -> Iterator[None]: +def fixed_time() -> Iterator[None]: with patch("time.time", lambda: 1547704837.040001 + time.timezone): yield diff --git a/tests/unit/test_logging.py b/tests/unit/test_logging.py index 89892b1d851..02808f03fef 100644 --- a/tests/unit/test_logging.py +++ b/tests/unit/test_logging.py @@ -42,7 +42,7 @@ def make_record(self, msg: str, level_name: str) -> logging.LogRecord: ("CRITICAL", "ERROR: hello\nworld"), ], ) - def test_format(self, level_name: str, expected: str, utc: None) -> None: + def test_format(self, level_name: str, expected: str) -> None: """ Args: level_name: a logging level name (e.g. "WARNING"). @@ -63,7 +63,7 @@ def test_format(self, level_name: str, expected: str, utc: None) -> None: ], ) def test_format_with_timestamp( - self, level_name: str, expected: str, utc: None + self, level_name: str, expected: str ) -> None: record = self.make_record("hello\nworld", level_name=level_name) f = IndentingFormatter(fmt="%(message)s", add_timestamp=True) @@ -77,7 +77,7 @@ def test_format_with_timestamp( ("CRITICAL", "DEPRECATION: hello\nworld"), ], ) - def test_format_deprecated(self, level_name: str, expected: str, utc: None) -> None: + def test_format_deprecated(self, level_name: str, expected: str) -> None: """ Test that logged deprecation warnings coming from deprecated() don't get another prefix. @@ -89,7 +89,7 @@ def test_format_deprecated(self, level_name: str, expected: str, utc: None) -> N f = IndentingFormatter(fmt="%(message)s") assert f.format(record) == expected - def test_thread_safety_base(self, utc: None) -> None: + def test_thread_safety_base(self) -> None: record = self.make_record( "DEPRECATION: hello\nworld", level_name="WARNING", @@ -106,7 +106,7 @@ def thread_function() -> None: thread.join() assert results[0] == results[1] - def test_thread_safety_indent_log(self, utc: None) -> None: + def test_thread_safety_indent_log(self) -> None: record = self.make_record( "DEPRECATION: hello\nworld", level_name="WARNING",