fix python3 issues, add missing plugin docs
--HG-- branch : trunk
This commit is contained in:
parent
d541713dca
commit
27aa14c20f
|
@ -0,0 +1,29 @@
|
|||
|
||||
pytest_genscript plugin
|
||||
=======================
|
||||
|
||||
generate standalone test script to be distributed along with an application.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
|
||||
|
||||
command line options
|
||||
--------------------
|
||||
|
||||
|
||||
``--genscript=path``
|
||||
create standalone py.test script at given target path.
|
||||
|
||||
Start improving this plugin in 30 seconds
|
||||
=========================================
|
||||
|
||||
|
||||
1. Download `pytest_genscript.py`_ plugin source code
|
||||
2. put it somewhere as ``pytest_genscript.py`` into your import path
|
||||
3. a subsequent ``py.test`` run will use your local version
|
||||
|
||||
Checkout customize_, other plugins_ or `get in contact`_.
|
||||
|
||||
.. include:: links.txt
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
pytest_logxml plugin
|
||||
====================
|
||||
|
||||
logging of test results in JUnit-XML format, for use with Hudson
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
and build integration servers. Based on initial code from Ross Lawley.
|
||||
|
||||
command line options
|
||||
--------------------
|
||||
|
||||
|
||||
``--xml=path``
|
||||
create junit-xml style report file at the given path.
|
||||
|
||||
Start improving this plugin in 30 seconds
|
||||
=========================================
|
||||
|
||||
|
||||
1. Download `pytest_logxml.py`_ plugin source code
|
||||
2. put it somewhere as ``pytest_logxml.py`` into your import path
|
||||
3. a subsequent ``py.test`` run will use your local version
|
||||
|
||||
Checkout customize_, other plugins_ or `get in contact`_.
|
||||
|
||||
.. include:: links.txt
|
|
@ -1,4 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
py.test and pylib: rapid testing and development utils
|
||||
|
||||
|
|
|
@ -44,16 +44,17 @@ def main(pybasedir, outfile, infile):
|
|||
name2src = {}
|
||||
for f in files:
|
||||
k = f.replace(os.sep, ".")[:-3]
|
||||
name2src[k] = open(f, "rb").read()
|
||||
name2src[k] = open(f, "r").read()
|
||||
|
||||
data = pickle.dumps(name2src, 2)
|
||||
data = zlib.compress(data, 9)
|
||||
data = base64.encodestring(data)
|
||||
data = data.decode("ascii")
|
||||
|
||||
exe = open(infile, "rb").read()
|
||||
exe = open(infile, "r").read()
|
||||
exe = exe.replace("@SOURCES@", data)
|
||||
|
||||
open(outfile, "wb").write(exe)
|
||||
open(outfile, "w").write(exe)
|
||||
os.chmod(outfile, 493) # 0755
|
||||
sys.stdout.write("generated standalone py.test at %r, have fun!\n" % outfile)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ def pytest_funcarg__repowc1(request):
|
|||
)
|
||||
for x in ('test_remove', 'test_move', 'test_status_deleted'):
|
||||
if request.function.__name__.startswith(x):
|
||||
print >>sys.stderr, ("saving repo", repo, "for", request.function)
|
||||
#print >>sys.stderr, ("saving repo", repo, "for", request.function)
|
||||
_savedrepowc = save_repowc(repo, wc)
|
||||
request.addfinalizer(lambda: restore_repowc(_savedrepowc))
|
||||
return repo, repourl, wc
|
||||
|
@ -67,7 +67,7 @@ def save_repowc(repo, wc):
|
|||
|
||||
def restore_repowc(obj):
|
||||
savedrepo, savedwc = obj
|
||||
print >>sys.stderr, ("restoring", savedrepo)
|
||||
#print >>sys.stderr, ("restoring", savedrepo)
|
||||
repo = savedrepo.new(basename=savedrepo.basename[:-2])
|
||||
assert repo.check()
|
||||
wc = savedwc.new(basename=savedwc.basename[:-2])
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import py
|
||||
from py.plugin.pytest_restdoc import deindent
|
||||
|
||||
def test_deindent():
|
||||
|
@ -9,6 +10,9 @@ def test_deindent():
|
|||
assert deindent(' foo\n bar\n') == ' foo\nbar\n'
|
||||
|
||||
class TestDoctest:
|
||||
def setup_class(cls):
|
||||
py.test.importorskip("docutils")
|
||||
|
||||
def pytest_funcarg__testdir(self, request):
|
||||
testdir = request.getfuncargvalue("testdir")
|
||||
testdir.plugins.append("restdoc")
|
||||
|
|
Loading…
Reference in New Issue