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

Tests warns about methods in TestSSHConfig within test_config.py "using nose-specific method: setup(self)" #2290

Open
marston19 opened this issue Aug 27, 2023 · 1 comment · May be fixed by #2306

Comments

@marston19
Copy link

Running pytest while working on #2286 it gave me warnings expressing methods within the TestSSHConfig class inside test_config.py were using nose test-specific methods, and support for such tests will be removed in future releases.

Since I'm not much accustomed to this subject, I wanted to first confirm whether these tests were indeed built as nose tests. Since the fix seems to be a simple find and replace (I did so, adding "_method" to the methods and pytest stopped issuing warnings about it), I'm more than happy to open a PR for it should it need to be addressed.

Below I'm attaching one of the warnings by Pytest. Since all of them look like this, I'm putting this one as an example, and the rest as a file attachment.

============================= test session starts ==============================
platform linux -- Python 3.11.4, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/kali/paramiko-testing/paramiko
configfile: pytest.ini
plugins: relaxed-2.0.1, xdist-3.3.1
collected 559 items
--snip--
tests/test_config.py::TestSSHConfig::test_init
  /home/kali/paramiko-testing/paramiko_venv/lib/python3.11/site-packages/_pytest/fixtures.py:895: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
  tests/test_config.py::TestSSHConfig::test_init is using nose-specific method: "setup(self)"
  To remove this warning, rename it to "setup_method(self)"
  See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
    fixture_result = next(generator)
--snip--
=========== 533 passed, 26 skipped, 31 warnings in 88.84s (0:01:28) ============

PS. Pytest also complains the use of isSet() within the test_update_environment method inside SSHClientTest in test_client.py to be deprecated, I'm happy to include it in the PR so it can also be updated as well.

tests/test_client.py::SSHClientTest::test_update_environment
  /home/kali/paramiko-testing/paramiko/tests/test_client.py:692: DeprecationWarning: isSet() is deprecated, use is_set() instead
    self.assertTrue(self.event.isSet())

pytest_log.log

@bskinn
Copy link
Contributor

bskinn commented Sep 27, 2023

Sorry for the long delay here -- yes, please do open a PR to fix these deprecations, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants