Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: resolve nose deprecation warnings with pytest #2249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/concurrency.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class concurrency:

# TODO: spin up multiple temp SSHDs / Paramiko servers / ???

def setup(self):
def setup_method(self):
cxn1 = Connection("localhost")
cxn2 = Connection("localhost")
cxn3 = Connection("localhost")
Expand Down
4 changes: 2 additions & 2 deletions integration/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def mixed_use_of_local_and_run(self):
assert result.stdout == "foo\n"

class sudo:
def setup(self):
def setup_method(self):
# NOTE: assumes a user configured for passworded (NOT
# passwordless)_sudo, whose password is 'mypass', is executing the
# test suite. I.e. our travis-ci setup.
Expand Down Expand Up @@ -137,7 +137,7 @@ def large_remote_commands_finish_cleanly(self):
assert len(lines) == len(words)

class command_timeout:
def setup(self):
def setup_method(self):
self.cxn = Connection("localhost")

def does_not_raise_exception_when_under_timeout(self):
Expand Down
4 changes: 2 additions & 2 deletions integration/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _support(*parts):

class Transfer_:
class get:
def setup(self):
def setup_method(self):
self.c = Connection("localhost")
self.remote = _support("file.txt")

Expand Down Expand Up @@ -50,7 +50,7 @@ def mode_preservation(self, tmpdir):
assert stat.S_IMODE(local.stat().mode) == 0o641

class put:
def setup(self):
def setup_method(self):
self.c = Connection("localhost")
self.remote = path.local.mkdtemp().join("file.txt").realpath()

Expand Down
2 changes: 1 addition & 1 deletion tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def uses_Fabric_prefix(self):
assert Config().prefix == "fabric"

class from_v1:
def setup(self):
def setup_method(self):
self.env = faux_v1_env()

def _conf(self, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions tests/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def explicit_False_turns_off_feature(self):
assert cxn.gateway is False

class proxy_jump:
def setup(self):
def setup_method(self):
self._expected_gw = Connection("jumpuser@jumphost:373")

def wins_over_default(self):
Expand Down Expand Up @@ -515,7 +515,7 @@ def may_be_given(self):
assert cxn.inline_ssh_env is False

class from_v1:
def setup(self):
def setup_method(self):
self.env = faux_v1_env()

def _cxn(self, **kwargs):
Expand Down Expand Up @@ -1054,7 +1054,7 @@ def calls_Remote_run_with_command_and_kwargs_and_returns_its_result(
assert r is remote.run.return_value

class shell:
def setup(self):
def setup_method(self):
self.defaults = Config.global_defaults()["run"]

@patch(remote_shell_path)
Expand Down
2 changes: 1 addition & 1 deletion tests/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def returns_results_mapping(self, method):


class ThreadingGroup_:
def setup(self):
def setup_method(self):
self.cxns = [Connection(x) for x in ("host1", "host2", "host3")]

@mark.parametrize("method", ALL_METHODS)
Expand Down
2 changes: 1 addition & 1 deletion tests/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def result_contains_fd_for_local_path(self, sftp_objs):
assert result.local is fd

class mode_concerns:
def setup(self):
def setup_method(self):
self.attrs = SFTPAttributes()
self.attrs.st_mode = 0o100644

Expand Down