Skip to content

Fix distutils.tests.test_register.RegisterTestCase.test_check_metadata_deprecated #115198

@terryjreedy

Description

@terryjreedy

When testing 3.11.8 installed on Win 10, the only failure is

FAIL: test_check_metadata_deprecated (distutils.tests.test_register.RegisterTestCase.test_check_metadata_deprecated)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Programs\Python311\Lib\distutils\tests\test_register.py", line 295, in test_check_metadata_deprecated
    self.assertEqual(len(w.warnings), 1)
AssertionError: 71 != 1

Running test.test_distutils, the warnings are

C:\Programs\Python311\Lib\distutils\command\install.py:326:
DeprecationWarning: check_home argument is deprecated and ignored.

and apparently 70 similar to

C:\Programs\Python311\Lib\distutils\command\check.py:128: DeprecationWarning:
The frontend.OptionParser class will be replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.

I don't know why this passes on CI and buildbots, but there are two easy fixes.

  1. Change the test to assertGreaterEqual(len(w.warnings), 1).
  2. Remove the test.

@vstinner Which do you think would be better?

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixestestsTests in the Lib/test dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions