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_normalization fails when NormalizationTest.txt is outdated #52031

Closed
florentx mannequin opened this issue Jan 26, 2010 · 4 comments
Closed

test_normalization fails when NormalizationTest.txt is outdated #52031

florentx mannequin opened this issue Jan 26, 2010 · 4 comments
Labels
tests Tests in the Lib/test dir topic-unicode type-bug An unexpected behavior, bug, or error

Comments

@florentx
Copy link
Mannequin

florentx mannequin commented Jan 26, 2010

BPO 7783
Nosy @ezio-melotti, @florentx
Dependencies
  • bpo-7787: Add an argument to test_support.open_urlresource to invalidate the cache
  • Files
  • issue7783_normalization_v2.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 = None
    closed_at = <Date 2010-03-15.18:19:21.817>
    created_at = <Date 2010-01-26.08:21:34.244>
    labels = ['type-bug', 'tests', 'expert-unicode']
    title = 'test_normalization fails when NormalizationTest.txt is outdated'
    updated_at = <Date 2010-03-21.14:36:54.817>
    user = 'https://github.com/florentx'

    bugs.python.org fields:

    activity = <Date 2010-03-21.14:36:54.817>
    actor = 'ezio.melotti'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-03-15.18:19:21.817>
    closer = 'flox'
    components = ['Tests', 'Unicode']
    creation = <Date 2010-01-26.08:21:34.244>
    creator = 'flox'
    dependencies = ['7787']
    files = ['16018']
    hgrepos = []
    issue_num = 7783
    keywords = ['patch']
    message_count = 4.0
    messages = ['98321', '98322', '98378', '101131']
    nosy_count = 2.0
    nosy_names = ['ezio.melotti', 'flox']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue7783'
    versions = ['Python 2.7', 'Python 3.2']

    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Jan 26, 2010

    The test "test_normalization" download a file from the "unicode.org" website and keep it in the local cache "Lib/test/data/" directory for next runs.
    On test setup, it verifies if the 1st line contains the right version "unicodedata.unidata_version".
    It should unlink the file if it is outdated.
    But it does not work as expected: it looks for the file in the wrong directory.

    ~ $ echo "# NormalizationTest-3.0.0.txt ~ outdated version" > Lib/test/data/NormalizationTest.txt

    ~ $ ./python -m test.regrtest -uall test_normalization
    test_normalization
    test test_normalization failed -- Traceback (most recent call last):
      File "./Lib/test/test_normalization.py", line 96, in test_main
        self.assertTrue(X == NFC(X) == NFD(X) == NFKC(X) == NFKD(X), c)
    AssertionError: 160

    1 test failed:
    test_normalization

    ~ $ cat Lib/test/data/NormalizationTest.txt
    # NormalizationTest-3.0.0.txt ~ outdated version

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

    florentx mannequin commented Jan 26, 2010

    Here is a patch.

    The function "test_support.open_urlresource" is enhanced with an optional argument "check" which receives a function. This "check" function accepts an open file as input and return False if the file is outdated.

    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Jan 26, 2010

    Now the fix depends on bpo-7787

    @florentx
    Copy link
    Mannequin Author

    florentx mannequin commented Mar 15, 2010

    Done with r78986.

    @florentx florentx mannequin closed this as completed Mar 15, 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 topic-unicode type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants