Skip to content

get rid of warnings in regrtest with -3 #46654

Closed

Description

@bethard
mannequin
BPO 2402
Nosy @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-08-21.14:52:48.669>
created_at = <Date 2008-03-18.19:12:36.109>
labels = ['interpreter-core', 'type-bug', 'tests']
title = 'get rid of warnings in regrtest with -3'
updated_at = <Date 2008-08-21.14:52:48.668>
user = 'https://bugs.python.org/bethard'

bugs.python.org fields:

activity = <Date 2008-08-21.14:52:48.668>
actor = 'benjamin.peterson'
assignee = 'none'
closed = True
closed_date = <Date 2008-08-21.14:52:48.669>
closer = 'benjamin.peterson'
components = ['Interpreter Core', 'Tests']
creation = <Date 2008-03-18.19:12:36.109>
creator = 'bethard'
dependencies = []
files = []
hgrepos = []
issue_num = 2402
keywords = []
message_count = 5.0
messages = ['63967', '63985', '63989', '63994', '71645']
nosy_count = 3.0
nosy_names = ['bethard', 'quentin.gallet-gilles', 'benjamin.peterson']
pr_nums = []
priority = 'critical'
resolution = 'duplicate'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2402'
versions = ['Python 2.6']

Activity

  1. bethard commented on Mar 18, 2008

    bethardmannequin
    MannequinAuthor

    Running the test suite with -3 enabled issues a load of warnings. The
    Python 2.6 library should not issue any py3k warnings.

  2. benjaminp commented on Mar 18, 2008

    @benjaminp
    Contributor

    No, *correct usage* of the stdlib should not result in Py3k warnings.
    Old APIs should still be tested, which I suppose is part of the reason
    that there are so many warnings from testing.

  3. bethard commented on Mar 18, 2008

    bethardmannequin
    MannequinAuthor

    Fair enough. I agree that the deprecated APIs should still be tested.
    But there are a lot of other warnings, e.g. where the standard lib uses
    has_key instead of in. These should be removed. The only
    warnings should be those that are actively testing deprecated APIs.

    Testing of deprecated APIs should probably temporarily suppress the Py3K
    warnings while they're executing, though that's not really crucial.

    Reducing the flood of warnings is really worthwhile -- I just fixed a
    bug in test_atexit which only appeared when -3 was supplied.

  4. benjaminp commented on Mar 18, 2008

    @benjaminp
    Contributor

    I made a little decorator which silences py3k warnings. It could be
    useful for test.test_support.

    def silence_py3k(func):
        def decorator(*args, **kwargs):
            warnings.simplefilter("ignore", warnings.DeprecationWarning)
            func(*args, **kwargs)
            warnings.simplefilter("default", warnings.DeprecationWarning)
        if sys.flags_py3kwarning:
            return decorator
        else:
            return func
  5. added
    type-bugAn unexpected behavior, bug, or error
    testsTests in the Lib/test dir
    on Mar 22, 2008
  6. benjaminp commented on Aug 21, 2008

    @benjaminp
    Contributor

    Brett has been doing this.

  7. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions