[TIP] Best practices for testing C extensions?

Florian Bruhin me at the-compiler.org
Sun Sep 8 12:41:19 PDT 2019


Hey Daniel,

On Sun, Sep 08, 2019 at 03:58:50PM +0200, Daniel Knüttel wrote:
> I bypassed the problem by putting `test/` into another directory (now
> it is `test/test/`) and writing a Makefile that runs 
> `((cd test && python3 -m pytest test/ -vv))`. But that doesn't seem to
> be too elegant and I would like to keep the standard layout. 

One somewhat popular solution is using the src layout:
https://blog.ionelmc.ro/2014/05/25/python-packaging/
https://hynek.me/articles/testing-packaging/

You might also want to use tox as a defacto-standard instead of a Makefile:
https://tox.readthedocs.io/

Florian

-- 
https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20190908/8fe7f71b/attachment.pgp>


More information about the testing-in-python mailing list