Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.buildout
Commits
01747fd6
Commit
01747fd6
authored
Oct 24, 2006
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a working-directory option.
parent
d9799304
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
4 deletions
+67
-4
zc.recipe.testrunner/CHANGES.txt
zc.recipe.testrunner/CHANGES.txt
+10
-0
zc.recipe.testrunner/setup.py
zc.recipe.testrunner/setup.py
+3
-2
zc.recipe.testrunner/src/zc/recipe/testrunner/README.txt
zc.recipe.testrunner/src/zc/recipe/testrunner/README.txt
+47
-2
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
+7
-0
No files found.
zc.recipe.testrunner/CHANGES.txt
View file @
01747fd6
...
...
@@ -2,6 +2,16 @@
Change History
**************
1.0.0b4 (2006-10-24)
====================
Feature Changes
---------------
- Added a working-directoy option to specify a working directory for
the generated script.
1.0.0b3 (2006-10-16)
====================
...
...
zc.recipe.testrunner/setup.py
View file @
01747fd6
...
...
@@ -7,7 +7,7 @@ def read(*rnames):
name
=
"zc.recipe.testrunner"
setup
(
name
=
name
,
version
=
"1.0.0b
3
"
,
version
=
"1.0.0b
4
"
,
author
=
"Jim Fulton"
,
author_email
=
"jim@zope.com"
,
description
=
"ZC Buildout recipe for creating test runners"
,
...
...
@@ -32,7 +32,8 @@ setup(
include_package_data
=
True
,
package_dir
=
{
''
:
'src'
},
namespace_packages
=
[
'zc'
,
'zc.recipe'
],
install_requires
=
[
'zc.buildout >=1.0.0b7'
,
'zope.testing'
,
'setuptools'
,
install_requires
=
[
'zc.buildout >=1.0.0b12'
,
'zope.testing'
,
'setuptools'
,
'zc.recipe.egg >=1.0.0a3'
,
],
test_suite
=
name
+
'.tests.test_suite'
,
...
...
zc.recipe.testrunner/src/zc/recipe/testrunner/README.txt
View file @
01747fd6
...
...
@@ -4,7 +4,7 @@ Test-Runner Recipe
The test-runner recipe, zc.recipe.testrunner, creates a test runner
for a project.
The test-runner recipe has
3
options:
The test-runner recipe has
several
options:
eggs
The eggs option specified a list of eggs to test given as one ore
...
...
@@ -20,11 +20,15 @@ extra-paths
One or more extra paths to include in the generated test script.
defaults
The defaults option lets you specify testrunner default
options. These are specified as Python source for an expression
yielding a list, typically a list literal.
working-directory
The working-directory option lets to specify a directory where the
tests will run. The testrunner will change to this directory whe
run.
(Note that, at this time, due to limitations in the Zope test runner,
the distributions cannot be zip files. TODO: Fix the test runner!)
...
...
@@ -216,6 +220,47 @@ extra-paths option to specify them:
'--test-path', '/sample-buildout/demo',
])
We can use the working-directory option to specify an working
directory:
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... develop = demo
... parts = testdemo
... offline = true
...
... [testdemo]
... recipe = zc.recipe.testrunner
... eggs = demo
... extra-paths = /usr/local/zope/lib/python
... working-directory = /foo/bar
... """)
>>> print system(os.path.join(sample_buildout, 'bin', 'buildout') + ' -q'),
>>> cat(sample_buildout, 'bin', 'testdemo')
#!/usr/local/bin/python2.4
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/demo',
'/sample-buildout/eggs/zope.testing-3.0-py2.3.egg',
'/sample-buildout/eggs/setuptools-0.6-py1.3.egg',
'/usr/local/zope/lib/python',
]
<BLANKLINE>
import os
os.chdir('/foo/bar')
<BLANKLINE>
import zope.testing.testrunner
<BLANKLINE>
if __name__ == '__main__':
zope.testing.testrunner.run([
'--test-path', '/sample-buildout/demo',
])
If we need to specify default options, we can use the defaults
option. For example, Zope 3 applications typically define test suites
in modules named ftests or tests. The default test runner behaviour
...
...
zc.recipe.testrunner/src/zc/recipe/testrunner/__init__.py
View file @
01747fd6
...
...
@@ -42,6 +42,12 @@ class TestRunner:
defaults
=
options
.
get
(
'defaults'
,
''
).
strip
()
if
defaults
:
defaults
=
'(%s) + '
%
defaults
wd
=
options
.
get
(
'working-directory'
,
''
)
if
wd
:
initialization
=
"import os
\
n
os.chdir(%r)"
%
wd
else
:
initialization
=
''
return
zc
.
buildout
.
easy_install
.
scripts
(
[(
options
[
'script'
],
'zope.testing.testrunner'
,
'run'
)],
...
...
@@ -52,6 +58,7 @@ class TestRunner:
TESTPATH
=
repr
(
test_paths
)[
1
:
-
1
].
replace
(
', '
,
",
\
n
'--test-path', "
),
)),
initialization
=
initialization
,
)
update
=
install
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment