[TIP] excluding test modules based on python version
me at the-compiler.org
Fri Jul 21 00:07:51 PDT 2017
On Fri, Jul 21, 2017 at 07:38:25AM +0100, Chris Withers wrote:
> I'd like to write some tests for a package that I maintain using some Python
> 3 - only syntax, type annotations in this case.
> How can I tell pytest or nose to ignore that file, but only when running
> under Python 2?
With pytest, put something like this in your conftest.py:
if path.basename == 'test_py3.py' and sys.version_info != 3:
As for nose, even the nose docs recommend not using nose anymore ;)
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
Size: 833 bytes
Desc: not available
More information about the testing-in-python