Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_py3kwarn fails when running the whole test suite #52020

Closed
florentx mannequin opened this issue Jan 24, 2010 · 6 comments
Closed

test_py3kwarn fails when running the whole test suite #52020

florentx mannequin opened this issue Jan 24, 2010 · 6 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@florentx
Copy link
Mannequin

florentx mannequin commented Jan 24, 2010

BPO 7772
Nosy @mdickinson, @ncoghlan, @florentx
Dependencies
  • bpo-8446: buildbot: DeprecationWarning not raised for icglue (test_py3kwarn.TestStdlibRemovals)
  • Files
  • issue7772_py3kwarn.diff: Patch, apply to trunk
  • 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 = 'https://github.com/florentx'
    closed_at = <Date 2010-08-08.21:15:30.045>
    created_at = <Date 2010-01-24.18:42:25.430>
    labels = ['type-bug', 'tests']
    title = 'test_py3kwarn fails when running the whole test suite'
    updated_at = <Date 2010-08-08.21:15:30.032>
    user = 'https://github.com/florentx'

    bugs.python.org fields:

    activity = <Date 2010-08-08.21:15:30.032>
    actor = 'flox'
    assignee = 'flox'
    closed = True
    closed_date = <Date 2010-08-08.21:15:30.045>
    closer = 'flox'
    components = ['Tests']
    creation = <Date 2010-01-24.18:42:25.430>
    creator = 'flox'
    dependencies = ['8446']
    files = ['15992']
    hgrepos = []
    issue_num = 7772
    keywords = ['patch']
    message_count = 6.0
    messages = ['98244', '98245', '100740', '102289', '102442', '113323']
    nosy_count = 3.0
    nosy_names = ['mark.dickinson', 'ncoghlan', 'flox']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue7772'
    versions = ['Python 2.7']

    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Jan 24, 2010

    "test_py3kwarn" fails when running the whole test suite

    This is a known behaviour, because of extension modules loaded by previous tests (which cannot be "reloaded").

    However, the warnings module store all the warnings when they appear in a dictionary attribute attached to the module which does the "import".

    We may read this dictionary attribute for the purpose of this test.

    @florentx florentx mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Jan 24, 2010
    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Jan 24, 2010

    Here comes the patch:

    • use test_support.__warningregistry__ to check past warnings
    • filter the warnings with "(module|package)", to be sure that they are silenced by "test_support.import_module"
    • fix test_reduce_move (it failed when run after test_unittest)

    Note:

    • it requires that all "deprecated" imports are filtered through the "test_support.import_module" function (issue bpo-7092)

    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Mar 9, 2010

    Fixed with r78815.
    Issue bpo-7092 should silence py3k warnings (soon).
    Next step is to activate "-3" on some buildbot.

    @florentx florentx mannequin closed this as completed Mar 9, 2010
    @florentx florentx mannequin self-assigned this Mar 9, 2010
    @mdickinson
    Copy link
    Member

    This still seems to be an issue for OS X. With the current trunk (r79716), I get:

    Mark-Dickinsons-MacBook-Pro:trunk dickinsm$ ./python.exe -3 ./Lib/test/regrtest.py test_macostools test_py3kwarn
    test_macostools
    /Users/dickinsm/python/svn/trunk/Lib/importlib/__init__.py:37: DeprecationWarning: In 3.x, the MacOS module is removed.
      __import__(name)
    /Users/dickinsm/python/svn/trunk/Lib/test/test_macostools.py:10: DeprecationWarning: In 3.x, the Carbon package is removed.
      import Carbon.File
    /Users/dickinsm/python/svn/trunk/Lib/test/test_macostools.py:11: DeprecationWarning: In 3.x, the macostools module is removed.
      import macostools
    test_py3kwarn
    test test_py3kwarn failed -- Traceback (most recent call last):
      File "/Users/dickinsm/python/svn/trunk/Lib/test/test_py3kwarn.py", line 387, in test_platform_specific_removals
        self.check_removal(module_name, optional=True)
      File "/Users/dickinsm/python/svn/trunk/Lib/test/test_py3kwarn.py", line 376, in check_removal
        .format(module_name))
    AssertionError: DeprecationWarning not raised for MacOS

    1 test OK.
    1 test failed:
    test_py3kwarn
    [40996 refs]

    @mdickinson mdickinson reopened this Apr 3, 2010
    @mdickinson
    Copy link
    Member

    I very much appreciate flox's efforts here, but IMO we really need some more robust solution to the problem of (testing + global warning state).

    See also bpo-4180.

    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Aug 8, 2010

    Fixed with r82149.

    @florentx florentx mannequin closed this as completed Aug 8, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant