[issue18258] Fix test discovery for test_codecmaps*.py

2014-07-01 Thread Zachary Ware

Zachary Ware added the comment:

Not forgotten, just hadn't gotten to on the list yet.

--
assignee:  -> zach.ware
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.5 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2014-07-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 27feb652d3ad by Zachary Ware in branch '3.4':
Issue #18258: Fix test discovery for test_codecmaps_*.
http://hg.python.org/cpython/rev/27feb652d3ad

New changeset b08921c7d1ec by Zachary Ware in branch 'default':
Issue #18258: Fix test discovery for test_codecmaps_*.
http://hg.python.org/cpython/rev/b08921c7d1ec

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2014-07-01 Thread Mark Lawrence

Mark Lawrence added the comment:

@Zach just a reminder that you've committed #18492 in case you'd forgotten this.

--
nosy: +BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-18 Thread Zachary Ware

Zachary Ware added the comment:

Done, issue18492.

I'll submit and updated patch here when (if :)) that one is applied.

I'm also looking into adding resource handling to unittest itself and it is 
going pretty well; I hope to have a patch ready for review for that soon.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-17 Thread R. David Murray

R. David Murray added the comment:

+1.  You should probably open a new issue for that proposal.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-17 Thread Zachary Ware

Zachary Ware added the comment:

R. David Murray wrote:
> So, the fact that the tests don't run if discovery is used is still a
> bug.  I'm not sure how we fix it, given the nature of the resource.

My preferred solution short of adding resource management to unittest is to add 
a "regrtest_run" flag to test.support, defaulting to False and set to True by 
regrtest (like verbose, use_resources, etc.).  Then we can replace the 
sys._getframe hack in support.requires with a simple check of 
support.regrtest_run.  If it's False, return.  This way, running the test 
module directly or via discovery will work the same way: all resources enabled.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-17 Thread R. David Murray

R. David Murray added the comment:

I'm sorry, I misspoke.  It only works when you run the test file as command:

   ./python Lib/test/test_codecmaps_cn.py

(which uses unittest.main, thus my error in calling it 'via unittest').

So, the fact that the tests don't run if discovery is used is still a bug.  I'm 
not sure how we fix it, given the nature of the resource.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

But I don't see any effect.

$ ./python -m test.regrtest -v test_codecmaps_tw
== CPython 3.3.2+ (3.3:359002d4370d+, Jul 14 2013, 15:34:54) [GCC 4.6.3]
==   Linux-3.8.0-27-generic-i686-with-debian-wheezy-sid little-endian
==   /home/serhiy/py/cpython-3.3/build/test_python_6295
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
[1/1] test_codecmaps_tw
test_errorhandle (test.test_codecmaps_tw.TestBIG5Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_file (test.test_codecmaps_tw.TestBIG5Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_supplemental (test.test_codecmaps_tw.TestBIG5Map) ... skipped "Use 
of the 'urlfetch' resource not enabled"
test_errorhandle (test.test_codecmaps_tw.TestCP950Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_file (test.test_codecmaps_tw.TestCP950Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_supplemental (test.test_codecmaps_tw.TestCP950Map) ... skipped 
"Use of the 'urlfetch' resource not enabled"

$ ./python -m unittest discover -v Lib/test/ "test_codecmaps_tw.py"
test_errorhandle (test_codecmaps_tw.TestBIG5Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_file (test_codecmaps_tw.TestBIG5Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_supplemental (test_codecmaps_tw.TestBIG5Map) ... skipped "Use of 
the 'urlfetch' resource not enabled"
test_errorhandle (test_codecmaps_tw.TestCP950Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_file (test_codecmaps_tw.TestCP950Map) ... skipped "Use of the 
'urlfetch' resource not enabled"
test_mapping_supplemental (test_codecmaps_tw.TestCP950Map) ... skipped "Use of 
the 'urlfetch' resource not enabled"

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-17 Thread R. David Murray

R. David Murray added the comment:

It enables the resource when the tests are run via unittest.  (That is, it is 
equivalent to specifying '-u urlfetch' when running regrtest.)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What is a purpose of `support.use_resources = ['urlfetch']`? I don't see any 
effect.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-07-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-06-18 Thread Zachary Ware

Changes by Zachary Ware :


--
type: enhancement -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18258] Fix test discovery for test_codecmaps*.py

2013-06-18 Thread Zachary Ware

New submission from Zachary Ware:

The test package is almost to the point where I can run `PCbuild\python_d.exe 
-m unittest discover Lib/test/ "test_*.py"` and get a useful result, the only 
thing that still blows up is multibytecodec_support.py.  I had not previously 
noticed this problem due to the way support.open_urlresource works, requiring 
the 'urlfetch' resource if and only if the requested file has not already been 
fetched before and stored in the Lib/test/data dir.  
multibytecodec_support.TestBase_Mapping blows things up because it uses 
__init__ instead of setUp to try opening the needed file, which causes 
ResourceDenied to be raised at class creation time rather than test run time, 
which unittest can't handle.  The attached patch fixes this (at the expense of 
opening and closing the file once per test method, rather than once per class) 
as well as converting the test_codecmaps* scripts from test_main to 
unittest.main.

--
components: Tests
files: test_codecmaps_discovery.diff
keywords: patch
messages: 191434
nosy: brett.cannon, ezio.melotti, zach.ware
priority: normal
severity: normal
status: open
title: Fix test discovery for test_codecmaps*.py
type: enhancement
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file30644/test_codecmaps_discovery.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com