From 7ffa3f3fcce614b83baba0bf0f523a3732187ff9 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:13:02 -0400 Subject: [PATCH] Reformat new files with line length 92 In anticipation of GH-358, minimize future work. --- flepimop/gempyor_pkg/src/gempyor/logging.py | 6 +----- flepimop/gempyor_pkg/tests/batch/test__sbatch.py | 8 ++------ flepimop/gempyor_pkg/tests/batch/test_write_manifest.py | 6 +----- .../gempyor_pkg/tests/logging/test__get_logging_level.py | 4 +--- .../gempyor_pkg/tests/logging/test_get_script_logger.py | 4 +--- 5 files changed, 6 insertions(+), 22 deletions(-) diff --git a/flepimop/gempyor_pkg/src/gempyor/logging.py b/flepimop/gempyor_pkg/src/gempyor/logging.py index db5123823..cf31bafc3 100644 --- a/flepimop/gempyor_pkg/src/gempyor/logging.py +++ b/flepimop/gempyor_pkg/src/gempyor/logging.py @@ -75,11 +75,7 @@ def emit(self, record: logging.LogRecord) -> None: [`logging.Handler.emit`](https://docs.python.org/3/library/logging.html#logging.Handler.emit) """ msg = self.format(record) - msg = ( - f"{msg}." - if self._punctuate and not msg.endswith(self._punctuation) - else msg - ) + msg = f"{msg}." if self._punctuate and not msg.endswith(self._punctuation) else msg click.echo( message=msg, file=self._file, nl=self._nl, err=self._err, color=self._color ) diff --git a/flepimop/gempyor_pkg/tests/batch/test__sbatch.py b/flepimop/gempyor_pkg/tests/batch/test__sbatch.py index c2fab6e9f..1c69d73d2 100644 --- a/flepimop/gempyor_pkg/tests/batch/test__sbatch.py +++ b/flepimop/gempyor_pkg/tests/batch/test__sbatch.py @@ -57,9 +57,7 @@ def test_export_option_causes_value_error(sample_sbatch_script: Path) -> None: ), ), ) -@pytest.mark.parametrize( - "verbosity", (None, logging.DEBUG, logging.INFO, logging.WARNING) -) +@pytest.mark.parametrize("verbosity", (None, logging.DEBUG, logging.INFO, logging.WARNING)) @pytest.mark.parametrize("dry_run", (True, False)) def test_output_validation( caplog: pytest.LogCaptureFixture, @@ -128,9 +126,7 @@ def subprocess_run_wraps(args, **kwargs): if not dry_run: args: list[str] = subprocess_run_patch.call_args.args[0] - assert len(args) == 2 + len(options) + min( - len(environment_variables), 1 - ) + assert len(args) == 2 + len(options) + min(len(environment_variables), 1) assert Path(args[-1]) == sample_sbatch_script if environment_variables: assert args[1].startswith("--export=") diff --git a/flepimop/gempyor_pkg/tests/batch/test_write_manifest.py b/flepimop/gempyor_pkg/tests/batch/test_write_manifest.py index 5374ade71..69234d0bc 100644 --- a/flepimop/gempyor_pkg/tests/batch/test_write_manifest.py +++ b/flepimop/gempyor_pkg/tests/batch/test_write_manifest.py @@ -52,11 +52,7 @@ def git_head_wraps(repository: Path) -> str: with patch("gempyor.batch._git_head", wraps=git_head_wraps) as git_head_patch: manifest_file = write_manifest( - job_name, - flepi_path, - project_path, - destination=destination, - **additional_meta + job_name, flepi_path, project_path, destination=destination, **additional_meta ) assert ( manifest_file == Path("manifest.json").absolute() diff --git a/flepimop/gempyor_pkg/tests/logging/test__get_logging_level.py b/flepimop/gempyor_pkg/tests/logging/test__get_logging_level.py index 210d0bd69..67480442c 100644 --- a/flepimop/gempyor_pkg/tests/logging/test__get_logging_level.py +++ b/flepimop/gempyor_pkg/tests/logging/test__get_logging_level.py @@ -28,7 +28,5 @@ def test__get_logging_level_negative_verbosity_value_error(verbosity: int) -> No (5, logging.DEBUG), ), ) -def test__get_logging_level_output_validation( - verbosity: int, expected_level: int -) -> None: +def test__get_logging_level_output_validation(verbosity: int, expected_level: int) -> None: assert _get_logging_level(verbosity) == expected_level diff --git a/flepimop/gempyor_pkg/tests/logging/test_get_script_logger.py b/flepimop/gempyor_pkg/tests/logging/test_get_script_logger.py index 1e0c5a2d0..b96e69cb7 100644 --- a/flepimop/gempyor_pkg/tests/logging/test_get_script_logger.py +++ b/flepimop/gempyor_pkg/tests/logging/test_get_script_logger.py @@ -37,9 +37,7 @@ def test_get_script_logger( if log_format is None: logger = get_script_logger(name, verbosity, handler=handler) else: - logger = get_script_logger( - name, verbosity, handler=handler, log_format=log_format - ) + logger = get_script_logger(name, verbosity, handler=handler, log_format=log_format) assert isinstance(logger, logging.Logger) assert logger.name == name