Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_deprecation(recwarn, monkeypatch):
execnet.PopenGateway().exit()
assert recwarn.pop(DeprecationWarning)
monkeypatch.setattr(socket, "socket", fails)
py.test.raises(Exception, execnet.SocketGateway, "localhost", 8811)
assert recwarn.pop(DeprecationWarning)
monkeypatch.setattr(subprocess, "Popen", fails)
py.test.raises(Exception, execnet.SshGateway, "not-existing")
assert recwarn.pop(DeprecationWarning)
def test_deprecation(recwarn, monkeypatch):
execnet.PopenGateway().exit()
assert recwarn.pop(DeprecationWarning)
monkeypatch.setattr(py.std.socket, 'socket', lambda *args: 0/0)
py.test.raises(Exception, 'execnet.SocketGateway("localhost", 8811)')
assert recwarn.pop(DeprecationWarning)
monkeypatch.setattr(py.std.subprocess, 'Popen', lambda *args,**kwargs: 0/0)
py.test.raises(Exception, 'execnet.SshGateway("not-existing")')
assert recwarn.pop(DeprecationWarning)
def setup_class(cls):
cls.gw = execnet.PopenGateway()
cls.gw.remote_exec(
"import py ; py.path.local(%r).pyimport()" %(__file__)
)
cls.gw.remote_init_threads(5)
# we need the remote test code to import
def setup_class(cls):
cls.gw = execnet.PopenGateway()
cls.gw.remote_exec(
"import py ; py.path.local(%r).pyimport()" %(__file__)
)
cls.gw.remote_init_threads(5)
# we need the remote test code to import