[TIP] pytest installation - setuptools causing failures

Florian Bruhin me at the-compiler.org
Wed Jul 13 02:07:29 PDT 2016


* Dale Potter <dalepotter at gmail.com> [2016-07-13 09:52:18 +0100]:
> Hello,
> 
> I am having some interesting errors when trying to set up pytest on a mac
> with a project that uses virtualenv.
> 
> I’ve run the installation instructions on
> http://docs.pytest.org/en/latest/getting-started.html :
> 
> 
> 1) pip install -U pytest
> 
> 2) Created a file ‘test_sample.py’ with contents:
> 
> def func(x):
>     return x + 1
> 
> def test_answer():
>     assert func(3) == 5
> 
> 3) Running py.test gives the output below.

It's simply pytest picking up setuptools' tests inside your
virtualenv, which is probably not what you intended.

Either name it something like .pyenv (as pytest excludes hidden
directories by default), or add "norecursedirs = pyenv" to your
pytest.ini:
http://pytest.org/latest/customize.html#confval-norecursedirs

Florian

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


More information about the testing-in-python mailing list