classification
Title: check for locale changes in test.regrtest
Type: enhancement Stage: needs patch
Components: Tests Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, ezio.melotti, ishimoto, nadeem.vawda, pitrou, python-dev, westley.martinez
Priority: normal Keywords: easy, patch

Created on 2012-02-26 22:47 by brett.cannon, last changed 2013-04-01 18:12 by brett.cannon. This issue is now closed.

Files
File name Uploaded Description Edit
test_14135.py westley.martinez, 2012-03-03 22:30 Test for checking locale changes
issue14135.patch ishimoto, 2012-07-27 15:18 review
check_locale.diff brett.cannon, 2013-04-01 17:46 review
Messages (10)
msg154414 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-02-26 22:47
Issue #14113 pointed out that test.support doesn't check if tests mucked with the locale after running.
msg154856 - (view) Author: Westley Martínez (westley.martinez) * Date: 2012-03-03 22:30
Here's a test that checks for changes to the locale.
msg154857 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-03-03 22:34
Thanks for the patch, but I think Brett meant to say that this should be added to Lib/test/regrtest.py:750, among the other resources.
msg166573 - (view) Author: Atsuo Ishimoto (ishimoto) * Date: 2012-07-27 15:18
Patch to check if locale was changed.

Since I'm not sure where to put tests for test.regrtest, I created 
new file, test.test_regrtest.
msg185742 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-01 16:53
New changeset 4fcd50a6dca7 by Brett Cannon in branch 'default':
Issue #14135: Make sure tests don't leave the locale changed for any
http://hg.python.org/cpython/rev/4fcd50a6dca7
msg185743 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-04-01 16:54
Sorry it took so wrong to get to this. It simply fell out of my purview.
msg185745 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-04-01 17:05
I had to back out this changeset as it totally broke the test suite here:

[ 91/372/90] test_defaultdict
test test_defaultdict crashed -- Traceback (most recent call last):
  File "/home/antoine/cpython/default/Lib/test/regrtest.py", line 1287, in runtest_inner
    with saved_test_environment(test, verbose, quiet) as environment:
  File "/home/antoine/cpython/default/Lib/test/regrtest.py", line 1251, in __enter__
    in self.resource_info())
  File "/home/antoine/cpython/default/Lib/test/regrtest.py", line 1250, in <genexpr>
    self.saved_values = dict((name, get()) for name, get, restore
  File "/home/antoine/cpython/default/Lib/test/regrtest.py", line 1237, in get_locale
    return tuple(map(locale.getlocale, self._locale_categories))
  File "/home/antoine/cpython/default/Lib/locale.py", line 523, in getlocale
    raise TypeError('category LC_ALL is not supported')
TypeError: category LC_ALL is not supported

(etc.)
msg185750 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-04-01 17:46
Can you check the attached patch works for you, Antoine?
msg185752 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-04-01 17:55
It does, thank you.
msg185754 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-04-01 18:11
New changeset dfe04eaa3924 by Brett Cannon in branch 'default':
Issue #14135: Let's try this again.
http://hg.python.org/cpython/rev/dfe04eaa3924
History
Date User Action Args
2013-04-01 18:12:10brett.cannonsetstatus: open -> closed
2013-04-01 18:11:49python-devsetmessages: + msg185754
2013-04-01 17:55:03pitrousetmessages: + msg185752
2013-04-01 17:46:45brett.cannonsetfiles: + check_locale.diff

messages: + msg185750
2013-04-01 17:05:22pitrousetstatus: closed -> open
versions: + Python 3.4, - Python 3.3
nosy: + pitrou

messages: + msg185745
2013-04-01 16:54:11brett.cannonsetstatus: open -> closed
resolution: fixed
messages: + msg185743
2013-04-01 16:53:27python-devsetnosy: + python-dev
messages: + msg185742
2013-03-26 17:51:00brett.cannonsetassignee: brett.cannon
2012-07-27 15:18:37ishimotosetfiles: + issue14135.patch

nosy: + ishimoto
messages: + msg166573

keywords: + patch
2012-03-03 22:34:12ezio.melottisetmessages: + msg154857
2012-03-03 22:30:43westley.martinezsetfiles: + test_14135.py
nosy: + westley.martinez
messages: + msg154856

2012-03-03 13:50:21ezio.melottisetnosy: + ezio.melotti

type: enhancement
stage: needs patch
2012-02-29 04:10:05eric.araujosettitle: check for locale changes in test.support -> check for locale changes in test.regrtest
2012-02-26 22:49:09nadeem.vawdasetnosy: + nadeem.vawda
2012-02-26 22:47:47brett.cannoncreate