Skip to content

Commit

Permalink
[gha] Add doctest to verify that skipif works
Browse files Browse the repository at this point in the history
  • Loading branch information
heapcrash committed Jul 3, 2020
1 parent bae22da commit 1cc5dec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def __getattr__(self, name):
def __setattr__(self, name, value):
return setattr(sys.stdout, name, value)
pwnlib.context.ContextType.defaults['log_console'] = stdout()
github_actions = os.environ.get('USER') == 'runner'
travis_ci = os.environ.get('USER') == 'travis'
'''

autoclass_content = 'both'
Expand Down
11 changes: 10 additions & 1 deletion pwnlib/tubes/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,15 @@ def __init__(self, user=None, host=None, port=22, password=None, key=None,
Example proxying:
.. doctest::
:skipif: github_actions
>>> False
True
.. doctest::
:skipif: github_actions
>>> s1 = ssh(host='example.pwnme',
... user='travis',
... password='demopass')
Expand Down Expand Up @@ -631,7 +640,7 @@ def __init__(self, user=None, host=None, port=22, password=None, key=None,
if os.path.exists(known_hosts):
self.client.load_host_keys(known_hosts)

has_proxy = (proxy_sock or proxy_command) and True
has_proxy = bool(proxy_sock or proxy_command)
if has_proxy:
if 'ProxyCommand' not in dir(paramiko):
self.error('This version of paramiko does not support proxies.')
Expand Down

0 comments on commit 1cc5dec

Please sign in to comment.