[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-05-06 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

New patch by Ezio looks good to me. Go ahead and commit. Please raise a 
separate issue for error reporting when invalid argument combinations are used. 
(i.e. additional keyword arguments but no callable.)

--

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-05-06 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 8fc801ca9ea1 by Ezio Melotti in branch 'default':
Issue #10775: assertRaises, assertRaisesRegex, assertWarns, and 
assertWarnsRegex now accept a keyword argument 'msg' when used as context 
managers.  Initial patch by Winston Ewert.
http://hg.python.org/cpython/rev/8fc801ca9ea1

--
nosy: +python-dev

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-05-06 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Done, thanks for the patch!

--
resolution:  - accepted
stage: patch review - committed/rejected
status: open - closed

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-05-05 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy:  -ncoghlan

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-04-30 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee: michael.foord - ezio.melotti

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-04-30 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Attached a revised patch.
While I agree that an error should be raised when extra args are provided in 
the context manager form, this is out of the scope of the issue, so I didn't 
include those changes.

--
stage: needs patch - patch review
Added file: http://bugs.python.org/file21839/issue10775-2.diff

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-04-30 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


Added file: http://bugs.python.org/file21840/issue10775-2.diff

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-04-30 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


Removed file: http://bugs.python.org/file21840/issue10775-2.diff

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-15 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Michael pointed out that I had completely missed the point of what the msg 
argument was about. Sorry for the noise.

--

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-15 Thread SilentGhost

SilentGhost ghost@gmail.com added the comment:

 I left a comment on the review.
You need to publish your comment if you want others to see it.

--
nosy: +SilentGhost

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-15 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

I showed robquad how to do the review stuff at PyCon but I forgot about the 
publish part. Robbie, if you hit Publish + Mail Comments near the top of the 
page after you've left comments, it'll send them out.


What he noticed was that changing to callable_obj in the assertRaises signature 
could break anyone who had been using callableObj as a named argument. Although 
it isn't explicitly documented, it's a named argument that someone is probably 
using. As for standardizing, it's probably best to match the general format of 
the library which is camelCase, and change the internal uses rather than a 
public method signature.

--
nosy: +brian.curtin

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-15 Thread Winston Ewert

Winston Ewert winstonew...@gmail.com added the comment:

The public methods were using both callable_obj and callableObj. Perhaps the 
patch should standardize on callableObj and accept callable_obj with a warning?

--

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-15 Thread Michael Foord

Changes by Michael Foord mich...@voidspace.org.uk:


--
assignee:  - michael.foord

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-14 Thread Robbie Clemons

Robbie Clemons robclem...@gmail.com added the comment:

Changing callableObj to callable_obj in assertRaises will break for anyone 
that's upgrading to 3.3.  I left a comment on the review.

--
nosy: +robquad

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-14 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Aren't such use cases already covered by assertRaisesRegex?

--
nosy: +ncoghlan

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-14 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

How does assertRaisesRegex address the use case in issue 3583?

--

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-03-14 Thread Winston Ewert

Winston Ewert winstonew...@gmail.com added the comment:

robquad mentions having left a comment on the review, but I'm not seeing how to 
view it. Can somebody explain?

It wasn't necessary to change the callable_obj bit, but both form were being 
used so I thought it best to standardize. Neither version of the parameter name 
shows up in the documentation.

--

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-02-15 Thread Winston Ewert

Winston Ewert winstonew...@gmail.com added the comment:

I decided to try my hand at writing a patch for python.

I ended up implementing the behavior for assertRaises, assertRaisesRegex, 
assertWarns, and assertWarnsRegex. I also made those functions complain about 
other arguments rather then just ignoring them.

--
keywords: +patch
nosy: +Winston.Ewert
Added file: http://bugs.python.org/file20765/patch.diff

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-01-21 Thread Daniel Urban

Changes by Daniel Urban urban.dani...@gmail.com:


--
nosy: +durban

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-01-20 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2011-01-03 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

I'm fine with this functionality being added in 3.3.

--

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



[issue10775] assertRaises as a context manager should accept a 'msg' keyword argument.

2010-12-26 Thread R. David Murray

New submission from R. David Murray rdmur...@bitdance.com:

assertRaises used as a method can't take a msg keyword argument because all 
args and keywords are passed to the callable.  But in context manager form it 
could, and this can be useful.  See, for example, issue 3583.

--
keywords: easy
messages: 124675
nosy: michael.foord, r.david.murray, rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: assertRaises as a context manager should accept a 'msg' keyword argument.
type: feature request
versions: Python 3.3

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