Re: [Python-Dev] Question over splitting unittest into a package

2009-12-30 Thread Benjamin Peterson
2009/12/30 Martin (gzlist) :
> Hi Benjamin,

Hi!

>
> In rev 74094 of Python, you split the unittest module up, could you
> point me at any bug entries or discussion over this revision so I can
> catch up?

This was mostly a discussion on IRC between Michael Foord and myself.

>
> As a side-effect you seem to have changed the method of marking a
> module as not worth including in a traceback to be no longer
> extensible.
>
> Before:
> 
>
> A global was set at the top of the module:
>
>    __unittest = 1
>
> Which is then checked for when constructing traceback output:
>
>    def _is_relevant_tb_level(self, tb):
>        return '__unittest' in tb.tb_frame.f_globals
>
> After:
> 
>
>    def _is_relevant_tb_level(self, tb):
>        globs = tb.tb_frame.f_globals
>        is_relevant =  '__name__' in globs and \
>            globs["__name__"].startswith("unittest")
>        del globs
>        return is_relevant
>
> Only packages actually named "unittest" can be excluded.
>
> What is now the prefered method of marking a module as test-internal?
> Overriding the leading-underscore _is_relevant_tb_level method? How
> can this be done cooperatively by different packages?

When I made that change, I didn't know that the __unittest "hack" was
being used elsewhere outside of unittest, so I felt fine replacing it
with another. While I still consider it an implementation detail, I
would be ok with exposing an "official" API for this. Perhaps
__unittest_ignore_traceback?


> I would have CCed a mailinglist with this question but don't like
> getting yelled at for posting on the wrong one, please feel free to do
> so with your reply if you feel it's appropriate (the CCing, not the
> yelling).

python-dev is perfect for this discussion.


-- 
Regards,
Benjamin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Question over splitting unittest into a package

2009-12-30 Thread Olemis Lang
On Wed, Dec 30, 2009 at 3:04 PM, Benjamin Peterson  wrote:
> 2009/12/30 Martin (gzlist) :
>> Hi Benjamin,
>
> Hi!
>
>> In rev 74094 of Python, you split the unittest module up,

+1

>> could you
>> point me at any bug entries or discussion over this revision so I can
>> catch up?
>
> This was mostly a discussion on IRC between Michael Foord and myself.
>

... and there was a previous thread about that some time ago here in python-dev
;o)

>>
>>    def _is_relevant_tb_level(self, tb):
>>        return '__unittest' in tb.tb_frame.f_globals
>>
>> After:
>> 
>>
>>    def _is_relevant_tb_level(self, tb):
>>        globs = tb.tb_frame.f_globals
>>        is_relevant =  '__name__' in globs and \
>>            globs["__name__"].startswith("unittest")
>>        del globs
>>        return is_relevant
>>

Had not seen this ... Hmmm ...
-1

>> Only packages actually named "unittest" can be excluded.
>>
>> What is now the prefered method of marking a module as test-internal?
>> Overriding the leading-underscore _is_relevant_tb_level method? How
>> can this be done cooperatively by different packages?
>
> When I made that change, I didn't know that the __unittest "hack" was
> being used elsewhere outside of unittest, so I felt fine replacing it
> with another. While I still consider it an implementation detail, I
> would be ok with exposing an "official" API for this. Perhaps
> __unittest_ignore_traceback?
>

Hmmm ... One of the issues I didn't notice ...

IMO +1 for leaving it as it was before (i.e. __unittest) because :

  - the double underscore should mean (CMIIW) that it's an implementation detail
  - not few libs use that name already ;o)

+0.5 for adding `__unittest_ignore_traceback` or something shorter
(e.g. `__unittest_ignore`) too ...

+1 for documenting that «hack»

PS: `assertRaises` context managers are great !!! BTW
;o)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Assessment of unittest 2.7 API : new features and opinions  -
http://feedproxy.google.com/~r/simelo-en/~3/cVOgG8NIBFY/assessment-of-unittest-27-api-new.html
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Question over splitting unittest into a package

2009-12-30 Thread Benjamin Peterson
2009/12/30 Olemis Lang :
> Hmmm ... One of the issues I didn't notice ...
>
> IMO +1 for leaving it as it was before (i.e. __unittest) because :
>
>  - the double underscore should mean (CMIIW) that it's an implementation 
> detail
>  - not few libs use that name already ;o)
>
> +0.5 for adding `__unittest_ignore_traceback` or something shorter
> (e.g. `__unittest_ignore`) too ...
>
> +1 for documenting that «hack»

Someone should probably file a tracker request about this.


-- 
Regards,
Benjamin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Rough 3.2 release schedule

2009-12-30 Thread Georg Brandl
... is in PEP 392.  Nothing much to see, except that the final date is
December 11, 2010.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Rough 3.2 release schedule

2009-12-30 Thread Michael Foord

On 30/12/2009 23:39, Georg Brandl wrote:

... is in PEP 392.  Nothing much to see, except that the final date is
December 11, 2010.

Georg

   
The PEP index incorrectly lists PEP 375 as being the Python 3.2 release 
schedule PEP:


http://python.org/dev/peps/

Michael

--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Rough 3.2 release schedule

2009-12-30 Thread Benjamin Peterson
2009/12/30 Michael Foord :
> On 30/12/2009 23:39, Georg Brandl wrote:
>>
>> ... is in PEP 392.  Nothing much to see, except that the final date is
>> December 11, 2010.
>>
>> Georg
>>
>>
>
> The PEP index incorrectly lists PEP 375 as being the Python 3.2 release
> schedule PEP:

Fixed.



-- 
Regards,
Benjamin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Question over splitting unittest into a package

2009-12-30 Thread Nick Coghlan
Olemis Lang wrote:
> PS: `assertRaises` context managers are great !!! BTW
> ;o)

The detailed comparison methods added for 2.7 are really nice too. It's
great getting error messages that tell me what I broke rather than "you
broke it!" :)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
---
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com