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

Fix test discovery for test_locale.py #61967

Closed
zware opened this issue Apr 16, 2013 · 5 comments
Closed

Fix test discovery for test_locale.py #61967

zware opened this issue Apr 16, 2013 · 5 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@zware
Copy link
Member

zware commented Apr 16, 2013

BPO 17767
Nosy @brettcannon, @ezio-melotti, @zware, @serhiy-storchaka
Files
  • test_locale_discovery.diff: test_locale.py fix, version 1
  • test_locale_discovery.v2.diff: Version 2
  • test_locale_discovery.v3.diff: Version 3
  • 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/serhiy-storchaka'
    closed_at = <Date 2013-07-17.11:36:52.830>
    created_at = <Date 2013-04-16.19:51:12.903>
    labels = ['type-bug', 'tests']
    title = 'Fix test discovery for test_locale.py'
    updated_at = <Date 2013-07-17.11:36:52.810>
    user = 'https://github.com/zware'

    bugs.python.org fields:

    activity = <Date 2013-07-17.11:36:52.810>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2013-07-17.11:36:52.830>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2013-04-16.19:51:12.903>
    creator = 'zach.ware'
    dependencies = []
    files = ['29891', '30631', '30765']
    hgrepos = []
    issue_num = 17767
    keywords = ['patch']
    message_count = 5.0
    messages = ['187117', '191387', '192272', '193221', '193223']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'ezio.melotti', 'python-dev', 'zach.ware', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17767'
    versions = ['Python 3.3', 'Python 3.4']

    @zware
    Copy link
    Member Author

    zware commented Apr 16, 2013

    This one actually had Failures rather than Errors; those failures arose from enUS_locale being None because it was being changed in test_main. This patch attempts to fix things by adapting get_enUS_locale() to return a tuple of a suitable setting for enUS_locale and a reason for skipping the tests that were formerly ignored if enUS_locale was None.

    @zware zware added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Apr 16, 2013
    @zware
    Copy link
    Member Author

    zware commented Jun 18, 2013

    Looking at this one again, I missed removing the run_unittest import. Here's a new patch.

    @zware
    Copy link
    Member Author

    zware commented Jul 4, 2013

    Here's a new patch addressing Serhiy's Rietveld comment. This patch also includes the addition of 'flush=True' to the verbose print in BaseLocalizedTest.setUp to make output look a little nicer.

    @serhiy-storchaka serhiy-storchaka self-assigned this Jul 17, 2013
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 17, 2013

    New changeset 3b883491a5f2 by Serhiy Storchaka in branch '3.3':
    Issue bpo-17767: test_locale now works with unittest test discovery.
    http://hg.python.org/cpython/rev/3b883491a5f2

    New changeset 60e72210683c by Serhiy Storchaka in branch 'default':
    Issue bpo-17767: test_locale now works with unittest test discovery.
    http://hg.python.org/cpython/rev/60e72210683c

    @serhiy-storchaka
    Copy link
    Member

    I combined two last Zachary's patches and added more robust locale test cleanup (old locale now restored even when print() in setUp() will failed).

    Thank you for your patch Zachary.

    @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

    2 participants