move examples to doc directory
--HG-- branch : trunk
This commit is contained in:
@@ -1 +0,0 @@
|
||||
# XXX this file should not need to be here but is here for proper sys.path mangling
|
||||
@@ -1,24 +0,0 @@
|
||||
import py
|
||||
from mysetup2.myapp import MyApp
|
||||
|
||||
def pytest_funcarg__mysetup(request):
|
||||
return MySetup(request)
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption("--ssh", action="store", default=None,
|
||||
help="specify ssh host to run tests with")
|
||||
|
||||
|
||||
class MySetup:
|
||||
def __init__(self, request):
|
||||
self.config = request.config
|
||||
|
||||
def myapp(self):
|
||||
return MyApp()
|
||||
|
||||
def getsshconnection(self):
|
||||
host = self.config.option.ssh
|
||||
if host is None:
|
||||
py.test.skip("specify ssh host with --ssh")
|
||||
return execnet.SshGateway(host)
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
class MyApp:
|
||||
def question(self):
|
||||
return 6 * 9
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
|
||||
def test_answer(mysetup):
|
||||
app = mysetup.myapp()
|
||||
answer = app.question()
|
||||
assert answer == 42
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
class TestClass:
|
||||
def test_function(self, mysetup):
|
||||
conn = mysetup.getsshconnection()
|
||||
# work with conn
|
||||
Reference in New Issue
Block a user