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

Fix pytest deprecation warning #14205

Merged

Conversation

dosas
Copy link
Collaborator

@dosas dosas commented Feb 28, 2024

Applying a mark to a fixture function never had any effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function

@dosas dosas requested review from a team as code owners February 28, 2024 10:39
Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
@dosas dosas force-pushed the fix/pytest-deprecation-warnings branch from 14a5ab9 to 8898d4f Compare February 28, 2024 10:59
@jyejare
Copy link
Member

jyejare commented Feb 28, 2024

@dosas Thanks for raising the PR. Since its a warning now and errors in future versions, we will have to address this sooner.

The appropriate solution I feel here is to use those markers directly on tests/test_classes/test_modules.

We shall get back to on this soon!!

@lhellebr
Copy link
Contributor

lhellebr commented Mar 4, 2024

Maybe there should be another PR putting those marks to the appropriate location but this one is good as it is, removing something that has no effect.

@Gauravtalreja1 Gauravtalreja1 added CherryPick PR needs CherryPick to previous branches 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Mar 5, 2024
@jyejare
Copy link
Member

jyejare commented Mar 5, 2024

@lhellebr Even I dont see any changes needed from PR diff that holds this PR from merging. But still need to assess once with non-diff code if the removals has any indirect impact!

I shall have that checked by EOD today!

Copy link
Member

@jyejare jyejare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming that removing the markers custom or inbuilt does not have any impact as they were not really being used by tests or any inhouse pytest plugins.

@dosas Did you try to cover all such occurrences throughout robottelo fixtures? or would you like us to be completing the effort ?

@dosas
Copy link
Collaborator Author

dosas commented Mar 6, 2024

I ran

pytest --collect-only -q tests -W error

Without any errors, so all occurrences should be covered

@jyejare
Copy link
Member

jyejare commented Mar 7, 2024

@dosas But the pytest warnings arent visible with only collection. But thats fine, we can search for remainings if any and post merge of this PR!

Thanks a lot for identifying the issue and raising the fix @dosas !!

@jyejare jyejare added the 6.12.z Introduced in or relating directly to Satellite 6.12 label Mar 7, 2024
@jyejare jyejare merged commit 215ddea into SatelliteQE:master Mar 7, 2024
10 of 11 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 7, 2024
Fix pytest deprecation warning:

Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
(cherry picked from commit 215ddea)
github-actions bot pushed a commit that referenced this pull request Mar 7, 2024
Fix pytest deprecation warning:

Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
(cherry picked from commit 215ddea)
github-actions bot pushed a commit that referenced this pull request Mar 7, 2024
Fix pytest deprecation warning:

Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
(cherry picked from commit 215ddea)
Gauravtalreja1 pushed a commit that referenced this pull request Mar 7, 2024
Fix pytest deprecation warning (#14205)

Fix pytest deprecation warning:

Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
(cherry picked from commit 215ddea)

Co-authored-by: dosas <[email protected]>
Gauravtalreja1 pushed a commit that referenced this pull request Mar 7, 2024
Fix pytest deprecation warning (#14205)

Fix pytest deprecation warning:

Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
(cherry picked from commit 215ddea)

Co-authored-by: dosas <[email protected]>
Gauravtalreja1 pushed a commit that referenced this pull request Mar 7, 2024
Fix pytest deprecation warning (#14205)

Fix pytest deprecation warning:

Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
(cherry picked from commit 215ddea)

Co-authored-by: dosas <[email protected]>
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
Fix pytest deprecation warning:

Applying a mark to a fixture function never had any
effect but is a common user error.

see: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants