diff --git a/changes/2688.misc.md b/changes/2688.misc.md new file mode 100644 index 000000000..8f6f20dba --- /dev/null +++ b/changes/2688.misc.md @@ -0,0 +1 @@ +E501 linting issues have been resolved for the tests/commands, tests/config and tests/console folder diff --git a/pyproject.toml b/pyproject.toml index e1d91adbb..35632c6df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -286,8 +286,8 @@ ignore = [ [tool.ruff.lint.per-file-ignores] # E501: line too long, to be fixed in future changes -"tests/*" = ["E501"] -"src/briefcase/bootstraps/*" = ["E501"] +"tests/integrations/*" = ["E501"] +"tests/platforms/*" = ["E501"] [tool.rumdl] diff --git a/tests/commands/base/test_finalize.py b/tests/commands/base/test_finalize.py index a46907dc4..eb5f03ef0 100644 --- a/tests/commands/base/test_finalize.py +++ b/tests/commands/base/test_finalize.py @@ -83,7 +83,8 @@ def test_finalize_single(base_command, first_app, second_app): def test_finalize_all_repeat(base_command, first_app, second_app): - "Multiple calls to finalize verifies host & tools multiple times, but only once on config" + """Multiple calls to finalize verifies host & tools multiple times, but only once on + "config.""" # Finalize apps twice. This is an approximation of what happens # when a command chain is executed; create, update, build and run will # all finalize; create will finalize the app configs, each command will @@ -113,7 +114,8 @@ def test_finalize_all_repeat(base_command, first_app, second_app): def test_finalize_single_repeat(base_command, first_app, second_app): - "Multiple calls to finalize verifies host & tools multiple times, but finalizes app config once" + """Multiple calls to finalize verifies host & tools multiple times, but finalizes + app "config once.""" # Finalize app twice. This is an approximation of what happens # when a command chain is executed; create, update, build and run will diff --git a/tests/commands/base/test_parse_config.py b/tests/commands/base/test_parse_config.py index d4ffe5021..41beb0619 100644 --- a/tests/commands/base/test_parse_config.py +++ b/tests/commands/base/test_parse_config.py @@ -32,7 +32,9 @@ def test_incomplete_global_config(base_command): with pytest.raises( BriefcaseConfigError, - match=r"Global configuration is incomplete \(missing 'bundle', 'project_name'\)", + match=( + r"Global configuration is incomplete \(missing 'bundle', 'project_name'\)" + ), ): base_command.parse_config(filename, {}) diff --git a/tests/commands/base/test_paths.py b/tests/commands/base/test_paths.py index fd29f3947..cd900ca87 100644 --- a/tests/commands/base/test_paths.py +++ b/tests/commands/base/test_paths.py @@ -43,7 +43,10 @@ def raise_calledprpcesserror(*a, **kw): with pytest.raises( BriefcaseCommandError, - match=r"Failed to create the Briefcase directory to store tools and support files:", + match=( + r"Failed to create the Briefcase directory to store tools and support" + r" files:" + ), ): DummyCommand(console=dummy_console, data_path=data_path) diff --git a/tests/commands/base/test_update_cookiecutter_cache.py b/tests/commands/base/test_update_cookiecutter_cache.py index 7bdd81c69..1dc0a157f 100644 --- a/tests/commands/base/test_update_cookiecutter_cache.py +++ b/tests/commands/base/test_update_cookiecutter_cache.py @@ -75,9 +75,9 @@ def test_new_repo_template_mkdir_interrupt(base_command, mock_git): """A really early interrupt will occur before the template dir is created.""" base_command.tools.git = mock_git - # We don't have a convenient point to insert a KeyboardInterrupt *before* creating the - # directory, so we fake the effect - make the side effect of the clone deletion of - # the entire folder; then raise the KeyboardInterrupt. + # We don't have a convenient point to insert a KeyboardInterrupt *before* creating + # the directory, so we fake the effect - make the side effect of the clone deletion + # of the entire folder; then raise the KeyboardInterrupt. def clone_failure(to_path, **kwargs): shutil.rmtree(to_path) raise KeyboardInterrupt() @@ -107,7 +107,8 @@ def test_new_repo_invalid_template_url(base_command, mock_git): with pytest.raises( BriefcaseCommandError, match=( - r"Unable to clone repository 'https://example.com/magic/special-template.git'" + r"Unable to clone repository" + r" 'https://example.com/magic/special-template.git'" ), ): base_command.update_cookiecutter_cache( @@ -131,14 +132,19 @@ def test_new_repo_invalid_template_url(base_command, mock_git): ("stderr_string", "error_message"), [ pytest.param( - "\n stderr: '\nfatal: could not clone repository 'https://example.com' \n'", + ( + "\n stderr: '\nfatal: could not clone repository" + " 'https://example.com' \n'" + ), "Could not clone repository 'https://example.com'.", id="tailing-whitespace-no-caps-no-period", ), pytest.param( ( - "\n stderr: '\nfatal: Could not read from remote repository.\n\n" - "Please make sure you have the correct access rights\nand the repository exists. \n'" + "\n stderr: '\nfatal: Could not read from remote repository." + "\n\nPlease" + " make sure you have the correct access rights\nand the repository" + " exists. \n'" ), ( "Could not read from remote repository.\n\nPlease make sure " @@ -149,7 +155,8 @@ def test_new_repo_invalid_template_url(base_command, mock_git): pytest.param( ( "\n stderr: '\nfatal: unable to access 'https://example.com/': " - "OpenSSL/3.2.2: error:0A000438:SSL routines::tlsv1 alert internal error'" + "OpenSSL/3.2.2: error:0A000438:SSL routines::tlsv1 alert internal " + "error'" ), ( "Unable to access 'https://example.com/': OpenSSL/3.2.2: " @@ -179,8 +186,12 @@ def test_repo_clone_error(stderr_string, error_message, base_command, mock_git): with pytest.raises( BriefcaseCommandError, - # The error message should not retain the "fatal:" prefix; it isn't useful information to the user. - match=f"Unable to clone repository '{re.escape(repository)}'.\n\n?(?=3.2.1"] - # Override the cache of paths to specify an app packages path, but no support package path + # Override the cache of paths to specify an app packages path, but no support + # package path create_command._briefcase_toml[myapp] = { "paths": {"app_packages_path": "path/to/app_packages"} } @@ -738,7 +742,7 @@ def test_app_requirements_requirement_installer_args_with_template_support( assert myapp.test_requires is None -def test_app_requirements_requirement_installer_args_without_requires_no_template_support( +def test_app_requirements_requirement_installer_args_without_requires_no_template_support( # noqa: E501 create_command, myapp, app_path, @@ -768,7 +772,7 @@ def test_app_requirements_requirement_installer_args_without_requires_no_templat assert myapp.test_requires is None -def test_app_requirements_requirement_installer_args_without_requires_with_template_support( +def test_app_requirements_requirement_installer_args_without_requires_with_template_support( # noqa: E501 create_command, myapp, app_path, diff --git a/tests/commands/create/test_install_image.py b/tests/commands/create/test_install_image.py index dd5c1543c..2a0bc0d9c 100644 --- a/tests/commands/create/test_install_image.py +++ b/tests/commands/create/test_install_image.py @@ -146,7 +146,10 @@ def test_requested_size_invalid_path(create_command, tmp_path, capsys): ) # The right message was written to output - expected = "Unable to find input/original-3742.png for 3742px sample image; using default\n" + expected = ( + "Unable to find input/original-3742.png for 3742px sample image; using" + " default\n" + ) assert capsys.readouterr().out == expected # The file was not copied @@ -213,7 +216,10 @@ def test_variant_without_variant_source_and_no_requested_size( ) # The right message was written to output - expected = "Unable to find input/original-round.png for round sample image; using default\n" + expected = ( + "Unable to find input/original-round.png for round sample image; using" + " default\n" + ) assert capsys.readouterr().out == expected # No file was installed. @@ -308,7 +314,10 @@ def test_variant_with_size_without_variants(create_command, tmp_path, capsys): ) # The right message was written to output - expected = "Unable to find input/original-round-3742.png for 3742px round sample image; using default\n" + expected = ( + "Unable to find input/original-round-3742.png for 3742px round sample image;" + " using default\n" + ) assert capsys.readouterr().out == expected # No file was installed. diff --git a/tests/commands/create/test_install_stub_binary.py b/tests/commands/create/test_install_stub_binary.py index c259e8523..e73a593af 100644 --- a/tests/commands/create/test_install_stub_binary.py +++ b/tests/commands/create/test_install_stub_binary.py @@ -264,8 +264,12 @@ def test_install_custom_stub_binary_url( # Confirm the right file was unpacked create_command.tools.shutil.unpack_archive.assert_called_with( - filename=tmp_path - / "data/stub/986428ef9d5a1852fc15d4367f19aa328ad530686056e9d83cdde03407c0bceb/My-Stub.zip", + filename=( + tmp_path + / "data/stub" + / "986428ef9d5a1852fc15d4367f19aa328ad530686056e9d83cdde03407c0bceb" + / "My-Stub.zip" + ), extract_dir=tmp_path / "base_path/build/my-app/tester/dummy", ) diff --git a/tests/commands/dev/test_run_dev_app.py b/tests/commands/dev/test_run_dev_app.py index a131ceec1..5148b5d5d 100644 --- a/tests/commands/dev/test_run_dev_app.py +++ b/tests/commands/dev/test_run_dev_app.py @@ -172,10 +172,9 @@ def test_dev_test_mode_with_args(dev_command, first_app, is_console_app, tmp_pat sys.executable, "-c", ( - "import runpy, sys;" - "sys.path.pop(0);" - "sys.argv.extend(['foo', 'bar', '--whiz']);" - 'runpy.run_module("tests.first", run_name="__main__", alter_sys=True)' + "import runpy, sys;sys.path.pop(0);sys.argv.extend(['foo', 'bar'," + ' \'--whiz\']);runpy.run_module("tests.first", run_name="__main__",' + " alter_sys=True)" ), ], env={ diff --git a/tests/commands/new/test_build_gui_context.py b/tests/commands/new/test_build_gui_context.py index a9aa0b4cb..b2e413f03 100644 --- a/tests/commands/new/test_build_gui_context.py +++ b/tests/commands/new/test_build_gui_context.py @@ -266,12 +266,14 @@ def test_console_bootstrap(new_command): assert context == { "console_app": True, - "app_source": """\ + "app_source": ( + """\ def main(): # Your app logic goes here print("Hello, World.") -""", +""" + ), "app_start_source": """\ from {{ cookiecutter.module_name }}.app import main diff --git a/tests/commands/publish/conftest.py b/tests/commands/publish/conftest.py index 2147114b6..c40d7f673 100644 --- a/tests/commands/publish/conftest.py +++ b/tests/commands/publish/conftest.py @@ -82,7 +82,8 @@ def _get_channels(self): } # These commands override the default behavior, simply tracking that - # they were invoked, rather than instantiating a Create/Update/Build/Package command. + # they were invoked, rather than instantiating a Create/Update/Build + # command. # This is for testing purposes. def package_command(self, app, **kwargs): self.actions.append(("package", app.app_name, kwargs.copy())) diff --git a/tests/commands/run/test_LogFilter.py b/tests/commands/run/test_LogFilter.py index 6fbd16374..5e8f99309 100644 --- a/tests/commands/run/test_LogFilter.py +++ b/tests/commands/run/test_LogFilter.py @@ -255,6 +255,7 @@ def clean_filter(line): assert log_filter.returncode is None assert not terminated else: - # The success/failure condition was detected, and the termination condition was processed + # The success/failure condition was detected, and the termination condition was + # processed assert log_filter.returncode == returncode assert terminated diff --git a/tests/commands/upgrade/test_call.py b/tests/commands/upgrade/test_call.py index f20a26ad0..cb58ee73e 100644 --- a/tests/commands/upgrade/test_call.py +++ b/tests/commands/upgrade/test_call.py @@ -194,7 +194,9 @@ def test_upgrade_unmanaged_tools(upgrade_command, mock_tool_registry, capsys): """If only unmanaged tools are requested to upgrade, error is raised.""" with pytest.raises( UpgradeToolError, - match=r"Briefcase is not managing not_installed, unmanaged, unmanaged_managed\.", + match=( + r"Briefcase is not managing not_installed, unmanaged, unmanaged_managed\." + ), ): upgrade_command(tool_list=["unmanaged", "unmanaged_managed", "not_installed"]) diff --git a/tests/config/test_merge_pep621_config.py b/tests/config/test_merge_pep621_config.py index 88d26d756..536bd248f 100644 --- a/tests/config/test_merge_pep621_config.py +++ b/tests/config/test_merge_pep621_config.py @@ -79,7 +79,8 @@ def test_missing_subkeys(): def test_specified_license_file(): - "The license file is included in the briefcase config if specified in the PEP621 config" + """The license file is included in the briefcase config if specified in the PEP621 + config.""" briefcase_config = {"key": "value"} merge_pep621_config( @@ -290,7 +291,8 @@ def test_dependencies_with_requires(): def test_no_test_dependencies(): - "If the global config doesn't specify test dependencies, test_requires are used as is" + """If the global config doesn't specify test dependencies,test_requires are used as + is.""" briefcase_config = {"key": "value", "test_requires": ["first", "second"]} merge_pep621_config( @@ -320,7 +322,8 @@ def test_optional_non_test_dependencies(): def test_test_dependencies_without_requires(): - "If the global config doesn't specify test requirements, test dependencies are used as is" + """If the global config doesn't specify test requirements, test dependencies are + used as is.""" briefcase_config = {"key": "value"} merge_pep621_config( diff --git a/tests/config/test_parse_config.py b/tests/config/test_parse_config.py index d40b986ad..7fa4783b7 100644 --- a/tests/config/test_parse_config.py +++ b/tests/config/test_parse_config.py @@ -22,13 +22,11 @@ def test_invalid_toml(): def test_no_briefcase_section(): """If the config file doesn't contain a briefcase tool section, raise an error.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.section] name="value" number=42 - """ - ) + """) with pytest.raises(BriefcaseConfigError, match=r"No tool\.briefcase section"): parse_config( @@ -41,13 +39,11 @@ def test_no_briefcase_section(): def test_no_apps(): """If the config file doesn't contain at least one briefcase app, raise an error.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] name="value" number=42 - """ - ) + """) with pytest.raises(BriefcaseConfigError, match="No Briefcase apps defined"): parse_config( @@ -60,15 +56,13 @@ def test_no_apps(): def test_single_minimal_app(): """A single app can be defined, but can exist without any app attributes.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 42 license.file = "LICENSE" [tool.briefcase.app.my_app] - """ - ) + """) global_options, apps = parse_config( config_file, @@ -93,8 +87,7 @@ def test_single_minimal_app(): def test_multiple_minimal_apps(): """The configuration can contain multiple apps without an explicit tool header.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase.app.first] number=37 license.file = "LICENSE" @@ -103,8 +96,7 @@ def test_multiple_minimal_apps(): app_name="my_app" number=42 license.file = "LICENSE.txt" - """ - ) + """) global_options, apps = parse_config( config_file, @@ -130,8 +122,7 @@ def test_multiple_minimal_apps(): def test_platform_override(): """An app can define platform settings that override base settings.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 basevalue = "the base" @@ -152,8 +143,7 @@ def test_platform_override(): [tool.briefcase.app.other_app.macOS] value = 4 platformvalue = "other macos platform" - """ - ) + """) global_options, apps = parse_config( config_file, @@ -196,8 +186,7 @@ def test_platform_override(): def test_platform_override_ordering(): """The order of platform processing doesn't affect output.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 basevalue = "the base" @@ -218,8 +207,7 @@ def test_platform_override_ordering(): [tool.briefcase.app.other_app.macOS] value = 4 platformvalue = "other macos platform" - """ - ) + """) global_options, apps = parse_config( config_file, @@ -262,8 +250,7 @@ def test_platform_override_ordering(): def test_format_override(): """An app can define format settings that override base and platform settings.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 basevalue = "the base" @@ -300,8 +287,7 @@ def test_format_override(): [tool.briefcase.app.other_app.macOS.app] value = 41 formatvalue = "other macos app format" - """ - ) + """) global_options, apps = parse_config( config_file, @@ -345,8 +331,7 @@ def test_format_override(): def test_format_override_ordering(): """The order of format processing doesn't affect output.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 basevalue = "the base" @@ -383,8 +368,7 @@ def test_format_override_ordering(): [tool.briefcase.app.other_app.macOS.Xcode] value = 41 formatvalue = "other macos app format" - """ - ) + """) global_options, apps = parse_config( config_file, @@ -427,8 +411,7 @@ def test_format_override_ordering(): def test_requires(): """Requirements can be specified.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 requires = ["base value"] @@ -453,8 +436,7 @@ def test_requires(): requires = ["appimage value"] [tool.briefcase.app.other_app] - """ - ) + """) # Request a macOS app global_options, apps = parse_config( @@ -576,8 +558,7 @@ def test_requires(): def test_document_types(): """Document types can be specified.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 license.file = "LICENSE" @@ -596,8 +577,7 @@ def test_document_types(): [tool.briefcase.app.other_app] - """ - ) + """) # Request a macOS app _global_options, apps = parse_config( @@ -634,8 +614,7 @@ def test_document_types(): def test_pep621_defaults(): - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [project] name = "awesome" version = "1.2.3" @@ -671,8 +650,7 @@ def test_pep621_defaults(): "toga-cocoa~=0.3.1", "std-nslog~=1.0.3" ] - """ - ) + """) _global_options, apps = parse_config( config_file, @@ -703,16 +681,14 @@ def test_pep621_defaults(): def test_license_is_string_project(): """The project definition contains a string definition for 'license'.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 license = "Some license" [tool.briefcase.app.my_app] appvalue = "the app" - """ - ) + """) console = Mock() global_options, apps = parse_config( @@ -729,8 +705,7 @@ def test_license_is_string_project(): "appvalue": "the app", "license": {"file": "LICENSE"}, } - console.warning.assert_called_once_with( - """ + console.warning.assert_called_once_with(""" ************************************************************************* ** WARNING: License Definition for the Project is Deprecated ** ************************************************************************* @@ -753,14 +728,12 @@ def test_license_is_string_project(): license.file = "LICENSE" ************************************************************************* -""" - ) +""") def test_license_is_string_project_and_app(): """The project and app definition contain a string definition for 'license'.""" - config_file = BytesIO( - b""" + config_file = BytesIO(b""" [tool.briefcase] value = 0 license = "Some license" @@ -768,8 +741,7 @@ def test_license_is_string_project_and_app(): [tool.briefcase.app.my_app] appvalue = "the app" license = "Another license" - """ - ) + """) console = Mock() global_options, apps = parse_config( @@ -788,8 +760,7 @@ def test_license_is_string_project_and_app(): } console.warning.assert_has_calls( [ - call( - """ + call(""" ************************************************************************* ** WARNING: License Definition for the Project is Deprecated ** ************************************************************************* @@ -812,10 +783,8 @@ def test_license_is_string_project_and_app(): license.file = "LICENSE" ************************************************************************* -""" - ), - call( - """ +"""), + call(""" ************************************************************************* ** WARNING: License Definition for 'my_app' is Deprecated ** ************************************************************************* @@ -838,7 +807,6 @@ def test_license_is_string_project_and_app(): license.file = "LICENSE" ************************************************************************* -""" - ), +"""), ] ) diff --git a/tests/console/Console/test_textwrap.py b/tests/console/Console/test_textwrap.py index 33056d1f7..0207fe2f3 100644 --- a/tests/console/Console/test_textwrap.py +++ b/tests/console/Console/test_textwrap.py @@ -9,42 +9,50 @@ "There is nothing wrong with your television set.", ), ( - "There is nothing wrong with your television set.\n" - "Do not attempt to adjust the picture.", - "There is nothing wrong with your television set.\n" - "Do not attempt to adjust the picture.", + ( + "There is nothing wrong with your television set.\n" + "Do not attempt to adjust the picture." + ), + ( + "There is nothing wrong with your television set.\n" + "Do not attempt to adjust the picture." + ), ), ( - "There is nothing\n\n\nwrong with your television set.\n\n" - "Do not attempt to adjust the picture. We are controlling transmission. If we wish to make it louder, " - "we will bring\nup the volume.\n", - "There is nothing\n" - "\n" - "\n" - "wrong with your television set.\n" - "\n" - "Do not attempt to adjust the picture. We are controlling transmission. If we\n" - "wish to make it louder, we will bring\n" - "up the volume.", + ( + "There is nothing\n\n\nwrong with your television set.\n\nDo not" + " attempt to adjust the picture. We are controlling transmission. If we" + " wish to make it louder, we will bring\nup the volume.\n" + ), + ( + "There is nothing\n\n\nwrong with your television set.\n\nDo not" + " attempt to adjust the picture. We are controlling transmission. If" + " we\nwish to make it louder, we will bring\nup the volume." + ), ), ( - "There is nothing wrong with your television set. Do not " - "attempt to adjust the picture. We are controlling transmission. " - "If we wish to make it louder, we will bring up the volume. If " - "we wish to make it softer, we will tune it to " - "a whisper. We will control the horizontal. We will control the vertical. " - "We can roll the image, make it flutter. We can change the " - "focus to a soft blur or sharpen it to crystal clarity. For the next " - "hour, sit quietly, and we will control all that you see and hear. We repeat: There is nothing " - "wrong with your television set.", - "There is nothing wrong with your television set. Do not attempt to adjust the\n" - "picture. We are controlling transmission. If we wish to make it louder, we\n" - "will bring up the volume. If we wish to make it softer, we will tune it to a\n" - "whisper. We will control the horizontal. We will control the vertical. We can\n" - "roll the image, make it flutter. We can change the focus to a soft blur or\n" - "sharpen it to crystal clarity. For the next hour, sit quietly, and we will\n" - "control all that you see and hear. We repeat: There is nothing wrong with your\n" - "television set.", + ( + "There is nothing wrong with your television set. Do not attempt to" + " adjust the picture. We are controlling transmission. If we wish to" + " make it louder, we will bring up the volume. If we wish to make it" + " softer, we will tune it to a whisper. We will control the horizontal." + " We will control the vertical. We can roll the image, make it flutter." + " We can change the focus to a soft blur or sharpen it to crystal" + " clarity. For the next hour, sit quietly, and we will control all that" + " you see and hear. We repeat: There is nothing wrong with your" + " television set." + ), + ( + "There is nothing wrong with your television set. Do not attempt to" + " adjust the\npicture. We are controlling transmission. If we wish to" + " make it louder, we\nwill bring up the volume. If we wish to make it" + " softer, we will tune it to a\nwhisper. We will control the" + " horizontal. We will control the vertical. We can\nroll the image," + " make it flutter. We can change the focus to a soft blur or\nsharpen" + " it to crystal clarity. For the next hour, sit quietly, and we" + " will\ncontrol all that you see and hear. We repeat: There is nothing" + " wrong with your\ntelevision set." + ), ), ], ) @@ -64,15 +72,27 @@ def test_textwrap(console, in_text, out_text): ), ( 80, - "This is 83 characters long. This is 83 characters long. This is 83 characters long.", - "This is 83 characters long. This is 83 characters long. This is 83 characters\nlong.", + ( + "This is 83 characters long. This is 83 characters long. This is 83" + " characters long." + ), + ( + "This is 83 characters long. This is 83 characters long. This is 83" + " characters\nlong." + ), ), ( 120, - "This is 144 characters long. This is 144 characters long. This is 144 characters long. " - "This is 144 characters long. This is 144 characters long.", - "This is 144 characters long. This is 144 characters long. " - "This is 144 characters long. This is 144 characters long. This\nis 144 characters long.", + ( + "This is 144 characters long. This is 144 characters long. This is 144" + " characters long. This is 144 characters long. This is 144 characters" + " long." + ), + ( + "This is 144 characters long. This is 144 characters long. This is 144" + " characters long. This is 144 characters long. This\nis 144 characters" + " long." + ), ), ], ) diff --git a/tests/console/Console/test_wait_bar.py b/tests/console/Console/test_wait_bar.py index 8a593c826..f86960a21 100644 --- a/tests/console/Console/test_wait_bar.py +++ b/tests/console/Console/test_wait_bar.py @@ -18,8 +18,8 @@ def test_wait_bar_done_message_non_interactive(non_interactive_console, capsys): with non_interactive_console.wait_bar("Wait message...", done_message="finished"): pass - assert capsys.readouterr().out == ( - "Wait message... started\nWait message... finished\n" + assert ( + capsys.readouterr().out == "Wait message... started\nWait message... finished\n" ) diff --git a/tests/console/test_Log.py b/tests/console/test_Log.py index 70c3a7aca..2e1a650a1 100644 --- a/tests/console/test_Log.py +++ b/tests/console/test_Log.py @@ -476,7 +476,10 @@ def test_log_with_context(console, capsys): "this is info output", "", "Entering Deep context...", - "Deep| --------------------------------------------------------------------", + ( + "Deep|" + " --------------------------------------------------------------------" + ), "Deep| this is deep context", "Deep| ", "Deep| [prefix] prefixed deep context", @@ -484,17 +487,26 @@ def test_log_with_context(console, capsys): "Deep| this is deep debug", "Deep| ", "Deep| Entering Really Deep context...", - "Really Deep| -------------------------------------------------------------", + ( + "Really Deep|" + " -------------------------------------------------------------" + ), "Really Deep| this is really deep context", "Really Deep| ", "Really Deep| [prefix2] prefixed really deep context", "Really Deep| ", "Really Deep| this is really deep debug", - "Really Deep| -------------------------------------------------------------", + ( + "Really Deep|" + " -------------------------------------------------------------" + ), "Deep| Leaving Really Deep context.", "Deep| ", "Deep| Pop back to deep", - "Deep| --------------------------------------------------------------------", + ( + "Deep|" + " --------------------------------------------------------------------" + ), "Leaving Deep context.", "", "Pop back to normal", @@ -521,9 +533,15 @@ def test_log_error_with_context(console, capsys): "this is info output", "", "Entering Deep context...", - "Deep| --------------------------------------------------------------------", + ( + "Deep|" + " --------------------------------------------------------------------" + ), "Deep| this is deep context", - "Deep| --------------------------------------------------------------------", + ( + "Deep|" + " --------------------------------------------------------------------" + ), "Leaving Deep context.", "", "this is cleanup", diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py index 23b9dec4c..075c2d872 100644 --- a/tests/test_cmdline.py +++ b/tests/test_cmdline.py @@ -116,7 +116,10 @@ def test_unknown_command(): {}, ), ( - "new --template=path/to/template --template-branch=experiment -C version=\\'1.2.3\\' -C other=42", + ( + "new --template=path/to/template --template-branch=experiment -C" + " version=\\'1.2.3\\' -C other=42" + ), { "template": "path/to/template", "template_branch": "experiment", @@ -155,7 +158,10 @@ def test_new_command(macOS_console, cmdline, expected_options, expected_override {}, ), ( - "convert --template=path/to/template --template-branch=experiment -C version=\\'1.2.3\\' -C other=42", + ( + "convert --template=path/to/template --template-branch=experiment -C" + " version=\\'1.2.3\\' -C other=42" + ), { "template": "path/to/template", "template_branch": "experiment", @@ -545,7 +551,10 @@ def test_command_explicit_unsupported_format(monkeypatch, macOS_console): with pytest.raises( UnsupportedCommandError, - match=r"The create command for the macOS homebrew format has not been implemented \(yet!\).", + match=( + r"The create command for the macOS homebrew format has not been implemented" + r" \(yet!\)." + ), ): do_cmdline_parse("create macOS homebrew", macOS_console)