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_find_module_encoding should test for a less specific message #58838

Closed
ericsnowcurrently opened this issue Apr 20, 2012 · 4 comments
Closed
Assignees
Labels
tests Tests in the Lib/test dir

Comments

@ericsnowcurrently
Copy link
Member

BPO 14633
Nosy @brettcannon, @ericsnowcurrently

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 2012-04-20.17:04:08.792>
created_at = <Date 2012-04-20.15:18:58.859>
labels = ['tests']
title = 'test_find_module_encoding should test for a less specific message'
updated_at = <Date 2012-04-20.17:32:30.494>
user = 'https://github.com/ericsnowcurrently'

bugs.python.org fields:

activity = <Date 2012-04-20.17:32:30.494>
actor = 'eric.snow'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2012-04-20.17:04:08.792>
closer = 'brett.cannon'
components = ['Tests']
creation = <Date 2012-04-20.15:18:58.859>
creator = 'eric.snow'
dependencies = []
files = []
hgrepos = []
issue_num = 14633
keywords = []
message_count = 4.0
messages = ['158837', '158838', '158851', '158857']
nosy_count = 2.0
nosy_names = ['brett.cannon', 'eric.snow']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue14633'
versions = ['Python 3.3']

@ericsnowcurrently
Copy link
Member Author

test_find_module_encoding (in Lib/test/test_imp.py), has the following check:

    self.assertRaisesRegex(SyntaxError,
        r"Non-UTF-8 code starting with '\\xf6'"
        r" in file .*badsyntax_pep3120.py",
        imp.find_module, 'badsyntax_pep3120', path)

It may be worth changing to something like this (aligning with the changes in bpo-14629):

    self.assertRaisesRegex(SyntaxError,
        r"invalid or missing encoding declaration",
        imp.find_module, 'badsyntax_pep3120', path)

@ericsnowcurrently ericsnowcurrently added the tests Tests in the Lib/test dir label Apr 20, 2012
@ericsnowcurrently ericsnowcurrently changed the title test_find_module_encoding should test for a less specific message (or test_find_module_encoding should test for a less specific message Apr 20, 2012
@ericsnowcurrently
Copy link
Member Author

or even _not_ check the message string?

@brettcannon
Copy link
Member

Committed in http://hg.python.org/cpython/rev/a281a6622714 (I think our issue detection algorithm grabs the last issue in a commit message instead of the first one).

@brettcannon brettcannon self-assigned this Apr 20, 2012
@ericsnowcurrently
Copy link
Member Author

thanks, Brett! That did the trick.

@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
Projects
None yet
Development

No branches or pull requests

2 participants