derwiki-adroll / mock

Automatically exported from code.google.com/p/mock
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

tests use unittest2 in python2.7 #194

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The tests/support.py file states:

    info = sys.version_info
    if info[:3] >= (3, 2, 0):
        # for Python 3.2 ordinary unittest is fine
        import unittest as unittest2
    else:
        import unittest2

Is there a specific reason why regular unittest is not used in Python 2.7? As 
far as I'm aware, that Python version is as featureful as unittest2.

I've did a quick test through replacing the conditional with:

    if info[:3] >= (3, 2, 0) or info[:2] == (2, 7):

and the tests completed fine.

Original issue reported on code.google.com by mgo...@gentoo.org on 7 Jan 2013 at 10:07

GoogleCodeExporter commented 9 years ago
I agree, but the proposed check is not enough. (3,0) >= (2,7) is True, but only 
py3.2 is on par with py2.7 with regards to the unittest module. I attached a 
patch that addresses this issue and cleans up the other version checks in 
support.py

Original comment by saschpe@mailbox.org on 12 Feb 2014 at 10:28

Attachments:

GoogleCodeExporter commented 9 years ago
btw. the patch is "hg import"-able.

Original comment by saschpe@mailbox.org on 12 Feb 2014 at 10:43

GoogleCodeExporter commented 9 years ago
mhm, missed the setuptools parts.

Original comment by saschpe@mailbox.org on 12 Feb 2014 at 10:55

Attachments:

GoogleCodeExporter commented 9 years ago
Ping. Any chance to get this applied?

Original comment by mgo...@gentoo.org on 21 Apr 2014 at 11:27