Replace yield_fixture()

Because yield_fixture() is deprecated since pytest 3.0 [1]. It is
not recommend to use the decorator instead of fixture().

[1] https://docs.pytest.org/en/latest/yieldfixture.html
This commit is contained in:
ag613915cao
2019-04-29 15:17:10 +07:00
parent 329385eb80
commit 0dabf7bbaa
+2 -2
View File
@@ -69,14 +69,14 @@ user = "user"
key_path = os.path.join(here, "{0}.key".format(user))
@pytest.yield_fixture()
@pytest.fixture
def ssh_server():
users = {user: key_path}
with mockssh.Server(users) as s:
yield s
@pytest.yield_fixture()
@pytest.fixture
def ssh(ssh_server):
yield SSHConnection(
ssh_server.host,