Fix warning messages due to nose test deprecation#4322
Open
bhouse-nexthop wants to merge 1 commit intosonic-net:masterfrom
Open
Fix warning messages due to nose test deprecation#4322bhouse-nexthop wants to merge 1 commit intosonic-net:masterfrom
bhouse-nexthop wants to merge 1 commit intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
e6993bb to
af295f7
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
@yxieca can you review and merge this simple PR? |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
eea17e7 to
253c044
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
@qiluo-msft can you please merge this very simple fix to get rid of a bunch of test noise? |
Contributor
|
AI agent on behalf of Ying: Quick review—overall change looks fine. One issue: in tests/swap_allocator_test.py the method remains @classmethod but renamed to setup_method. Pytest expects setup_method(self, method) and it should not be a classmethod. Suggest either keep @classmethod setup_class/teardown_class, or change to def setup_method(self, method): without @classmethod. Everything else looks OK. |
Collaborator
|
/azp run |
Multiple warnings similar to the below are emitted during test execution: ``` tests/vnet_route_check_test.py::TestVnetRouteCheck::test_vnet_route_check /usr/lib/python3/dist-packages/_pytest/fixtures.py:901: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release. tests/vnet_route_check_test.py::TestVnetRouteCheck::test_vnet_route_check 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 ``` Rename `def setup(self)` to `def setup_method(self)` and `def teardown(self)` to `def teardown_method(self)` as per documentation. Signed-off-by: Brad House <bhouse@nexthop.ai>
|
Azure Pipelines successfully started running 1 pipeline(s). |
d38d59f to
f132fd5
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
you're right, I missed that in my sed, switched from setup_method to setup_class for that one function. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Multiple warnings similar to the below are emitted during test execution:
How I did it
Rename
def setup(self)todef setup_method(self)anddef teardown(self)todef teardown_method(self)as per documentation.How to verify it
Observe when running unit tests these warnings are no longer output
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)