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

Failure in test_pkgutil run from command-line #69991

Closed
SilentGhost mannequin opened this issue Dec 5, 2015 · 5 comments
Closed

Failure in test_pkgutil run from command-line #69991

SilentGhost mannequin opened this issue Dec 5, 2015 · 5 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@SilentGhost
Copy link
Mannequin

SilentGhost mannequin commented Dec 5, 2015

BPO 25805
Nosy @malemburg, @brettcannon, @pfmoore, @tarekziade, @merwok, @bitdancer, @dstufft
Files
  • issue25805.diff
  • 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/brettcannon'
    closed_at = <Date 2016-08-12.17:54:39.350>
    created_at = <Date 2015-12-05.09:08:04.437>
    labels = ['type-bug', 'tests']
    title = 'Failure in test_pkgutil run from command-line'
    updated_at = <Date 2016-08-12.17:58:29.716>
    user = 'https://bugs.python.org/SilentGhost'

    bugs.python.org fields:

    activity = <Date 2016-08-12.17:58:29.716>
    actor = 'brett.cannon'
    assignee = 'brett.cannon'
    closed = True
    closed_date = <Date 2016-08-12.17:54:39.350>
    closer = 'brett.cannon'
    components = ['Tests']
    creation = <Date 2015-12-05.09:08:04.437>
    creator = 'SilentGhost'
    dependencies = []
    files = ['42255']
    hgrepos = []
    issue_num = 25805
    keywords = ['patch']
    message_count = 5.0
    messages = ['255939', '262251', '272548', '272550', '272551']
    nosy_count = 10.0
    nosy_names = ['lemburg', 'brett.cannon', 'paul.moore', 'tarek', 'eric.araujo', 'r.david.murray', 'SilentGhost', 'alexis', 'python-dev', 'dstufft']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue25805'
    versions = ['Python 3.5', 'Python 3.6']

    @SilentGhost
    Copy link
    Mannequin Author

    SilentGhost mannequin commented Dec 5, 2015

    Running ./python Lib/test/test_pkgutil.py I got one test failing:

    test.support.TestFailed: Traceback (most recent call last):
      File "Lib/test/test_pkgutil.py", line 346, in test_get_loader_handles_missing_loader_attribute
        self.assertIsNotNone(pkgutil.get_loader(__name__))
    AssertionError: unexpectedly None

    When run as ./python -m test test_pkgutil everything is fine.

    @SilentGhost SilentGhost mannequin added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Dec 5, 2015
    @SilentGhost
    Copy link
    Mannequin Author

    SilentGhost mannequin commented Mar 23, 2016

    Upon further investigation it seems this particular test needs to be just skipped when running as __main__.

    @SilentGhost
    Copy link
    Mannequin Author

    SilentGhost mannequin commented Aug 12, 2016

    Could anyone could have a look at this fairly trivial patch?

    @brettcannon brettcannon self-assigned this Aug 12, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 12, 2016

    New changeset 863258dcb745 by Brett Cannon in branch 'default':
    Issue bpo-25805: Skip a test for test_pkgutil when __name__ == __main__.
    https://hg.python.org/cpython/rev/863258dcb745

    @brettcannon
    Copy link
    Member

    Since most people just run tests using -m test I only applied the fix to 3.6. Thanks for the patch, SilentGhost!

    @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