classification
Title: test_find_module_encoding should test for a less specific message
Type: Stage: resolved
Components: Tests Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, eric.snow
Priority: normal Keywords:

Created on 2012-04-20 15:18 by eric.snow, last changed 2012-04-20 17:32 by eric.snow. This issue is now closed.

Messages (4)
msg158837 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2012-04-20 15:18
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 issue14629):

    self.assertRaisesRegex(SyntaxError,
        r"invalid or missing encoding declaration",
        imp.find_module, 'badsyntax_pep3120', path)
msg158838 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2012-04-20 15:22
or even _not_ check the message string?
msg158851 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-04-20 17:04
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).
msg158857 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2012-04-20 17:32
thanks, Brett!  That did the trick.
History
Date User Action Args
2012-04-20 17:32:30eric.snowsetmessages: + msg158857
2012-04-20 17:04:08brett.cannonsetstatus: open -> closed
messages: + msg158851

assignee: brett.cannon
resolution: fixed
stage: resolved
2012-04-20 15:22:02eric.snowsetmessages: + msg158838
2012-04-20 15:19:30eric.snowsetversions: + Python 3.3
components: + Tests
title: test_find_module_encoding should test for a less specific message (or -> test_find_module_encoding should test for a less specific message
2012-04-20 15:18:58eric.snowcreate