[code-quality] How and where to add tests for Python 3

François Magimel francois.magimel at etu.enseeiht.fr
Mon Aug 25 10:36:27 CEST 2014


Le 25/08/2014 02:24, Ian Cordasco a écrit :
> On Sun, Aug 24, 2014 at 3:07 PM, François Magimel
> <francois.magimel at etu.enseeiht.fr> wrote:
>> Hello!
>>
>> I'm new in this mailing, so I will introduce myself first. I'm François
>> (alias Linkid), a French engineering student who code mainly in Python.
>> I'm involved in some open source projects and some of them like Django
>> or OpenStack.
>>
>> I would like to add a test for Python 3 to check an import, but I don't
>> really know on which project (pep8, pyflakes, …) to do that and how to
>> do it (by a push request on github or somewhere else, by a bug report,
>> …). I searched some clue and I think my test should be used by pyflakes,
>> but I'm not sure… So, here are my questions:
>> - on which project should I add a Python 3 import test ?
>> - how I should process ?
>>
>> I think it could help be a lot if someone explain me what one project
>> really check, if it is possible.
>>
>> Thank you.
>>
>> François Magimel (Linkid)
> Hello François,
>
> I'm not quite sure anyone on this list can answer your question. You
> haven't given us any guidance about what the check is that you would
> like to add. Do you want to check for imports that are not used in
> Python 3? Are you looking for imports that would fail on Python 3
> instead? Are you looking to ensure some style of imports? Perhaps
> you're looking to do what openstack/hacking already does (ensure only
> modules are imported)? There are too many possibilities for us to be
> helpful.
>
> Further, unless what you wish to add is part of
> http://legacy.python.org/dev/peps/pep-0008/, I can at least tell you
> that it does *not* belong in pep8. If you can give us more details I
> can also tell you whether it belongs in PyFlakes. If it turns out it
> does not belong in PyFlakes, you can always write and release your own
> plugin for Flake8.
>
> Sorry I cannot be more helpful,
> Ian

Hello,

Oh, yes, it will be better if I give some details. My code didn't pass
my python 3 tests due to an import of string. As a matter of fact, I was
using string.letters which is not in python 3 anymore. However, when I
tested my code with flake8, I wasn't warned about it. So, I would like
to add this warning (maybe to PyFlakes, but I'm not sure). And I think
it is not only an OpenStack issue because it concerns every projects.
So, if someone can help me to add it (to PyFlakes?) by giving me the
process (PR on GitHub?), I will be very happy to contribute :).

Thank you for your answer, Ian.
François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/code-quality/attachments/20140825/d2dca661/attachment.sig>


More information about the code-quality mailing list