Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions setuptools/tests/config/test_apply_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
(
Expand All @@ -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,
Expand Down Expand Up @@ -298,7 +298,7 @@ def test_utf8_maintainer_in_metadata( # issue-3663
'content_str',
'not_content_str',
),
(
[
pytest.param(
PEP639_LICENSE_TEXT,
'MIT',
Expand All @@ -320,7 +320,7 @@ def test_utf8_maintainer_in_metadata( # issue-3663
'License: ',
id='license-expression',
),
),
],
)
def test_license_in_metadata(
license,
Expand Down
10 changes: 5 additions & 5 deletions setuptools/tests/config/test_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -288,7 +288,7 @@ def test_dynamic_without_file(self, tmp_path):

@pytest.mark.parametrize(
"example",
(
[
"""
[project]
name = "myproj"
Expand All @@ -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"
Expand Down Expand Up @@ -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")
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions setuptools/tests/config/test_setupcfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions setuptools/tests/test_build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions setuptools/tests/test_core_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

@pytest.mark.parametrize(
("content", "result"),
(
[
pytest.param(
"Just a single line",
None,
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion setuptools/tests/test_dist_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions setuptools/tests/test_editable_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down
4 changes: 2 additions & 2 deletions setuptools/tests/test_glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@pytest.mark.parametrize(
('tree', 'pattern', 'matches'),
(
[
('', b'', []),
('', '', []),
(
Expand Down Expand Up @@ -37,7 +37,7 @@
b'*.rst',
(b'CHANGES.rst', b'README.rst'),
),
),
],
)
def test_glob(monkeypatch, tmpdir, tree, pattern, matches):
monkeypatch.chdir(tmpdir)
Expand Down
4 changes: 2 additions & 2 deletions setuptools/tests/test_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setuptools/tests/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Loading