Skip to content

Commit

Permalink
- Fixed a bug in the ftest command and added a test.
Browse files Browse the repository at this point in the history
- Fixed a trivial test failure with Python 3 of the previous release.
  • Loading branch information
strichter committed Mar 3, 2013
1 parent cb52f23 commit 8ed9d4e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,9 @@ zope.testrunner Changelog
4.3.1 (unreleased)
==================

- Nothing changed yet.
- Fixed a bug in the `ftest` command and added a test.

- Fixed a trivial test failure with Python 3 of the previous release.


4.3.0 (2013-03-02)
Expand Down
5 changes: 3 additions & 2 deletions src/zope/testrunner/eggsupport.py
Expand Up @@ -97,10 +97,11 @@ def finalize_options(self):

def run(self):
from zope.testrunner import run
args = ['IGNORE_ME']

dist = self.distribution
where = dist.package_dir or '.'
args = ['IGNORE_ME', '--test-path', where]
for src_loc in (dist.package_dir.values() or ['.']):
args += ['--test-path', src_loc]

if dist.install_requires:
dist.fetch_build_eggs(dist.install_requires)
Expand Down
23 changes: 23 additions & 0 deletions src/zope/testrunner/testrunner-eggsupport.txt
Expand Up @@ -17,6 +17,29 @@ exposes it as such via an entry point.
>>> eps['ftest']
EntryPoint.parse('ftest = zope.testrunner.eggsupport:ftest')

Let's now run this command:

>>> import zope.testrunner
>>> org_run = zope.testrunner.run

>>> def run(args):
... print(' '.join(args))
>>> zope.testrunner.run = run

>>> import os
>>> import setuptools.dist
>>> dist = setuptools.dist.Distribution(
... {'package_dir': {'': os.path.dirname(__file__)},
... 'script_name': 'foo'})

>>> from zope.testrunner.eggsupport import ftest
>>> ftest(dist).run()
IGNORE_ME --test-path ...zope/testrunner

Cleanup:

>>> zope.testrunner.run = org_run


Skipping Tests with Layers
--------------------------
Expand Down

0 comments on commit 8ed9d4e

Please sign in to comment.