Skip to content

Commit 7129ad1

Browse files
Fix formatting of tests and change dash deprecation method name
1 parent 938a339 commit 7129ad1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

setuptools/dist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def _parse_config_files(self, filenames=None): # noqa: C901
600600
continue
601601

602602
val = parser.get(section, opt)
603-
opt = self.dash_to_underscore_warning(opt, section)
603+
opt = self.warn_dash_deprecation(opt, section)
604604
opt = self.make_option_lowercase(opt, section)
605605
opt_dict[opt] = (filename, val)
606606

@@ -626,7 +626,7 @@ def _parse_config_files(self, filenames=None): # noqa: C901
626626
except ValueError as e:
627627
raise DistutilsOptionError(e) from e
628628

629-
def dash_to_underscore_warning(self, opt, section):
629+
def warn_dash_deprecation(self, opt, section):
630630
if section in (
631631
'options.extras_require', 'options.data_files',
632632
):

setuptools/tests/test_config.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,9 @@ def test_not_utf8(self, tmpdir):
507507
with get_dist(tmpdir):
508508
pass
509509

510-
def test_dash_to_underscore_warning(self, tmpdir):
511-
# dash_to_underscore_warning() is a method in setuptools.dist
512-
# remove this test and method when dash convert to underscore in setup.cfg
513-
# is no longer supported
510+
def test_warn_dash_deprecation(self, tmpdir):
511+
# warn_dash_deprecation() is a method in setuptools.dist
512+
# remove this test and the method when no longer needed
514513
fake_env(
515514
tmpdir,
516515
'[metadata]\n'
@@ -523,11 +522,12 @@ def test_dash_to_underscore_warning(self, tmpdir):
523522
with pytest.warns(UserWarning, match=msg):
524523
with get_dist(tmpdir) as dist:
525524
metadata = dist.metadata
526-
assert metadata.author_email == '[email protected]'
527-
assert metadata.maintainer_email == '[email protected]'
528525

529-
def test_uppercase_warning(self, tmpdir):
530-
# remove this test and the method uppercase_warning() in setuptools.dist
526+
assert metadata.author_email == '[email protected]'
527+
assert metadata.maintainer_email == '[email protected]'
528+
529+
def test_make_option_lowercase(self, tmpdir):
530+
# remove this test and the method make_option_lowercase() in setuptools.dist
531531
# when no longer needed
532532
fake_env(
533533
tmpdir,

0 commit comments

Comments
 (0)