diff --git a/setuptools/tests/config/test_apply_pyprojecttoml.py b/setuptools/tests/config/test_apply_pyprojecttoml.py index 8f48c4316d..73653600cb 100644 --- a/setuptools/tests/config/test_apply_pyprojecttoml.py +++ b/setuptools/tests/config/test_apply_pyprojecttoml.py @@ -250,7 +250,7 @@ def test_no_explicit_content_type_for_missing_extension(tmp_path): @pytest.mark.parametrize( ("pyproject_text", "expected_maintainers_meta_value"), - ( + [ pytest.param( PEP621_EXAMPLE, ( @@ -269,7 +269,7 @@ def test_no_explicit_content_type_for_missing_extension(tmp_path): ), id='international-email', ), - ), + ], ) def test_utf8_maintainer_in_metadata( # issue-3663 expected_maintainers_meta_value, @@ -298,7 +298,7 @@ def test_utf8_maintainer_in_metadata( # issue-3663 'content_str', 'not_content_str', ), - ( + [ pytest.param( PEP639_LICENSE_TEXT, 'MIT', @@ -320,7 +320,7 @@ def test_utf8_maintainer_in_metadata( # issue-3663 'License: ', id='license-expression', ), - ), + ], ) def test_license_in_metadata( license, diff --git a/setuptools/tests/config/test_pyprojecttoml.py b/setuptools/tests/config/test_pyprojecttoml.py index 6d995d23af..9602233943 100644 --- a/setuptools/tests/config/test_pyprojecttoml.py +++ b/setuptools/tests/config/test_pyprojecttoml.py @@ -201,7 +201,7 @@ def test_all_listed_in_dynamic(self, tmp_path): assert len(expanded_project["entry-points"]) == 1 assert expanded_project["entry-points"]["other"]["c"] == "mod.c:func [extra]" - @pytest.mark.parametrize("missing_dynamic", ("scripts", "gui-scripts")) + @pytest.mark.parametrize("missing_dynamic", ["scripts", "gui-scripts"]) def test_scripts_not_listed_in_dynamic(self, tmp_path, missing_dynamic): self.write_entry_points(tmp_path) dynamic = {"scripts", "gui-scripts", "entry-points"} - {missing_dynamic} @@ -288,7 +288,7 @@ def test_dynamic_without_file(self, tmp_path): @pytest.mark.parametrize( "example", - ( + [ """ [project] name = "myproj" @@ -297,7 +297,7 @@ def test_dynamic_without_file(self, tmp_path): [my-tool.that-disrespect.pep518] value = 42 """, - ), + ], ) def test_ignore_unrelated_config(tmp_path, example): pyproject = tmp_path / "pyproject.toml" @@ -332,7 +332,7 @@ def test_invalid_example(tmp_path, example, error_msg): read_configuration(pyproject) -@pytest.mark.parametrize("config", ("", "[tool.something]\nvalue = 42")) +@pytest.mark.parametrize("config", ["", "[tool.something]\nvalue = 42"]) def test_empty(tmp_path, config): pyproject = tmp_path / "pyproject.toml" pyproject.write_text(config, encoding="utf-8") @@ -341,7 +341,7 @@ def test_empty(tmp_path, config): assert read_configuration(pyproject) == {} -@pytest.mark.parametrize("config", ("[project]\nname = 'myproj'\nversion='42'\n",)) +@pytest.mark.parametrize("config", ["[project]\nname = 'myproj'\nversion='42'\n"]) def test_include_package_data_by_default(tmp_path, config): """Builds with ``pyproject.toml`` should consider ``include-package-data=True`` as default. diff --git a/setuptools/tests/config/test_setupcfg.py b/setuptools/tests/config/test_setupcfg.py index 495337a9a5..ee0df95948 100644 --- a/setuptools/tests/config/test_setupcfg.py +++ b/setuptools/tests/config/test_setupcfg.py @@ -904,9 +904,9 @@ def test_python_requires_invalid(self, tmpdir): """ ), ) - with pytest.raises(Exception): - with get_dist(tmpdir) as dist: - dist.parse_config_files() + ############# with pytest.raises(Exception): + with get_dist(tmpdir) as dist: + dist.parse_config_files() def test_cmdclass(self, tmpdir): module_path = Path(tmpdir, "src/custom_build.py") # auto discovery for src diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 2cd0a0a8ed..f8281c6462 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -265,7 +265,7 @@ def test_build_wheel(self, build_backend): modules = [f for f in python_scripts if not f.endswith('setup.py')] assert len(modules) == 1 - @pytest.mark.parametrize('build_type', ('wheel', 'sdist')) + @pytest.mark.parametrize('build_type', ['wheel', 'sdist']) def test_build_with_existing_file_present(self, build_type, tmpdir_cwd): # Building a sdist/wheel should still succeed if there's # already a sdist/wheel in the destination directory. @@ -908,7 +908,7 @@ def test_setup_py_file_abspath(self, tmpdir_cwd): build_backend = self.get_build_backend() build_backend.build_sdist("temp") - @pytest.mark.parametrize('build_hook', ('build_sdist', 'build_wheel')) + @pytest.mark.parametrize('build_hook', ['build_sdist', 'build_wheel']) def test_build_with_empty_setuppy(self, build_backend, build_hook): files = {'setup.py': ''} path.build(files) diff --git a/setuptools/tests/test_core_metadata.py b/setuptools/tests/test_core_metadata.py index 5ec6df3dfe..df2ff4d38a 100644 --- a/setuptools/tests/test_core_metadata.py +++ b/setuptools/tests/test_core_metadata.py @@ -35,7 +35,7 @@ @pytest.mark.parametrize( ("content", "result"), - ( + [ pytest.param( "Just a single line", None, @@ -61,7 +61,7 @@ "Leading whitespace\nIn\n Multiline comment", id="remove_leading_whitespace_multiline", ), - ), + ], ) def test_rfc822_unescape(content, result): assert (result or content) == rfc822_unescape(rfc822_escape(content)) diff --git a/setuptools/tests/test_dist_info.py b/setuptools/tests/test_dist_info.py index f65d0afbe4..ed6e456268 100644 --- a/setuptools/tests/test_dist_info.py +++ b/setuptools/tests/test_dist_info.py @@ -49,7 +49,7 @@ def test_tag_arguments(self, tmp_path): dist_info = next(tmp_path.glob("*.dist-info")) assert dist_info.name.startswith("proj-42a") - @pytest.mark.parametrize("keep_egg_info", (False, True)) + @pytest.mark.parametrize("keep_egg_info", [False, True]) def test_output_dir(self, tmp_path, keep_egg_info): config = "[metadata]\nname=proj\nversion=42\n" (tmp_path / "setup.cfg").write_text(config, encoding="utf-8") diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py index cf2dbe9e0f..632c350dad 100644 --- a/setuptools/tests/test_editable_install.py +++ b/setuptools/tests/test_editable_install.py @@ -262,12 +262,12 @@ def test_nspkg_file_is_unique(self, tmp_path, monkeypatch): @pytest.mark.parametrize( "impl", - ( + [ "pkg_resources", # "pkgutil", => does not work - ), + ], ) - @pytest.mark.parametrize("ns", ("myns.n",)) + @pytest.mark.parametrize("ns", ["myns.n"]) def test_namespace_package_importable( self, venv, tmp_path, ns, impl, editable_opts ): diff --git a/setuptools/tests/test_glob.py b/setuptools/tests/test_glob.py index 8d225a4461..5ef9a19ac6 100644 --- a/setuptools/tests/test_glob.py +++ b/setuptools/tests/test_glob.py @@ -6,7 +6,7 @@ @pytest.mark.parametrize( ('tree', 'pattern', 'matches'), - ( + [ ('', b'', []), ('', '', []), ( @@ -37,7 +37,7 @@ b'*.rst', (b'CHANGES.rst', b'README.rst'), ), - ), + ], ) def test_glob(monkeypatch, tmpdir, tree, pattern, matches): monkeypatch.chdir(tmpdir) diff --git a/setuptools/tests/test_sdist.py b/setuptools/tests/test_sdist.py index 5b435fe111..3686ee4c1f 100644 --- a/setuptools/tests/test_sdist.py +++ b/setuptools/tests/test_sdist.py @@ -899,7 +899,7 @@ def files_for_symlink_in_extension_depends(tmp_path, dep_path): } @pytest.mark.parametrize( - "dep_path", ("myheaders/dir/file.h", "myheaders/dir/../dir/file.h") + "dep_path", ["myheaders/dir/file.h", "myheaders/dir/../dir/file.h"] ) def test_symlink_in_extension_depends(self, monkeypatch, tmp_path, dep_path): # Given a project with a symlinked dir and a "depends" targeting that dir @@ -947,7 +947,7 @@ def files_for_external_path_in_extension_depends(tmp_path, dep_path): } @pytest.mark.parametrize( - "dep_path", ("$tmp_path$/external/dir/file.h", "../external/dir/file.h") + "dep_path", ["$tmp_path$/external/dir/file.h", "../external/dir/file.h"] ) def test_external_path_in_extension_depends(self, monkeypatch, tmp_path, dep_path): # Given a project with a "depends" targeting an external dir diff --git a/setuptools/tests/test_wheel.py b/setuptools/tests/test_wheel.py index c3b215a474..bdf1493d24 100644 --- a/setuptools/tests/test_wheel.py +++ b/setuptools/tests/test_wheel.py @@ -585,7 +585,7 @@ def test_wheel_no_dist_dir(): # create an empty zip file zipfile.ZipFile(wheel_path, 'w').close() with tempdir() as install_dir: - with pytest.raises(ValueError): + with pytest.raises(ValueError, match=r"\.dist-info not found"): _check_wheel_install( wheel_path, install_dir, None, project_name, version, None )