zope.testrunner's buildout makes failing tests

Bug #580083 reported by Tres Seaver on 2010-05-13
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zope.testrunner
Fix Released
Critical
Lennart Regebro

Bug Description

On [the trunk of zope.testrunner::

  $ cd /tmp
  $ svn co $ZSVN/zope.testrunner/trunk testrunner
  ...

I can run the tests fine from a virtualenv::

  $ /opt/Python-2.6.5/bin/virtualenv --no-site-packages /tmp/xxx
  ...
  $ /tmp/xxx/bin/python setup.py develop
  ...
  $ /tmp/xxx/bin/easy_install zope.testing
  ...
  $ /tmp/xxx/bin/python setup.py test
  ...
  running build_ext
  Running zope.testrunner.layer.UnitTests tests:
    Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
    Ran 27 tests with 0 failures and 0 errors in 22.256 seconds.
  Tearing down left over layers:
    Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.

but not via zc.buildout:

  $ /opt/Python-2.6.5/bin/python bootstrap.py
  ...
  $ bin/buildout
  ...
  $ bin/test
  <doctest spew>
  (pdb)

Tres Seaver (tseaver) wrote :

Having the buildout's own tests fail makes it impossible to do "normal"
development in this project.

Changed in zope.testrunner:
status: New → Confirmed
importance: Undecided → High
importance: High → Critical
assignee: nobody → Lennart Regebro (regebro-gmail)
Marius Gedminas (mgedmin) wrote :

FWIW 'python setup.py test' works (and leaves two zipped egg files in the current working directory).

Marius Gedminas (mgedmin) wrote :

Looking at bin/test as generated by buildout I see

    zope.testrunner.run([
        '--test-path', '/home/mg/src/zope.testrunner/src',
        '--test-path', '/home/mg/.buildout/eggs/zope.testing-3.9.5-py2.6.egg',
        ])

which means it's trying to run zope.testing's test suite too, which fails.

My fault: I added zope.testing to buildout.cfg:

  [test]
  recipe = zc.recipe.testrunner
  eggs = zope.testrunner
         zope.testing

because zope.testrunner itself doesn't depend on zope.testing and thus bin/test used to fail with an import error.

What's the right buildout incantation of enabling extra test dependencies without running their tests?

summary: - zope.testrunner's buldout makes failing tests
+ zope.testrunner's buildout makes failing tests
Marius Gedminas (mgedmin) wrote :

I couldn't find a cleaner way, so ended up adding extras_require to setup.py with a 'test' extra depending on zope.testing. and changing the buildout recipe to

  [test]
  recipe = zc.recipe.testrunner
  eggs = zope.testrunner[test]

It works.

Changed in zope.testrunner:
status: Confirmed → Fix Committed

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marius Gedminas wrote:

> What's the right buildout incantation of enabling extra test
> dependencies without running their tests?

Should be something like:

 [test]
 recipe = zc.recipe.testrunner
 eggs = zope.testrunner [test]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkwYxgQACgkQ+gerLs4ltQ6jWwCeKm7GgJK/Xtch/yjAMJ6azPii
ohoAn2jcs6Xr5IoPiuoYG5Tirs4Adwfg
=EGj5
-----END PGP SIGNATURE-----

Tres Seaver (tseaver) wrote :
Changed in zope.testrunner:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers