Commits

Anonymous committed 924599d

add --ssh option, skip ssh test if None

Comments (0)

Files changed (2)

tests/conftest.py

+
+def pytest_addoption(parser):
+    """ add command line options. """
+    parser.addoption("--ssh", action="store", default=None)
+
+

tests/test_execute.py

 
-from py.test import raises, mark
+from py.test import raises, skip, config
 
 import os
 
     assert code == 0
 
 
-@mark.skipif("os.getenv('BU_TEST_SSH')!='Test'")
 def test_execute_execnet_ssh(queue):
-    q = queue('foo ssh=pseudoscience.co.uk:\n echo 1', 'foo')
+    if config.option.ssh is None:
+        skip("specify ssh host with --ssh")
+    q = queue('foo ssh=%s:\n echo 1' % config.option.ssh, 'foo')
     node = q.get()
     out, code = node()
     assert out == '1'