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 test warnings that escaped somehow #15714

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

AlanCoding
Copy link
Member

SUMMARY

Looking at the output of another test:

awx/main/tests/functional/test_rbac_credential.py .                      [ 97%]
awx/conf/tests/test_env.py .                                             [ 97%]
awx/conf/tests/unit/test_fields.py ..................................... [ 98%]
..................                                                       [ 98%]
awx/conf/tests/unit/test_registry.py ...............                     [ 99%]
/awx_devel/awx/main/tests/functional/models/test_workflow.py:380: SyntaxWarning: "is" with a literal. Did you mean "=="?
  assert len(workflow_job.labels.all()) is 0
/awx_devel/awx/main/tests/unit/utils/test_common.py:321: SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert (h("192.168.56.101"), None)
/awx_devel/awx/main/tests/unit/utils/test_common.py:[339](https://github.com/ansible/awx/actions/runs/12396891431/job/34605975660?pr=15711#step:4:340): SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert (h("@#$%)$#(TUFAS_DG"), None)
awx/conf/tests/unit/test_settings.py ..........................          [100%]

Warnings were supposed to be blocking with recent @webknjaz changes, so I can't really tell you what's going on.

But the 2 issues are obviously correct and trivial to fix, so let's do it.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

I vaguely recall seeing these. The reason they are not turned into errors, I think, is that they are probably emitted before pytest's plugin engine loads. If you run it as python -Werror -Im pytest, it'd influence the entire Python process, revealing more things.

@AlanCoding
Copy link
Member Author

Looking better

2024-12-18T19:56:46.7296423Z awx/main/tests/functional/test_inventory_source_migration.py ...         [ 96%]
2024-12-18T19:56:47.2396771Z awx/main/tests/functional/test_licenses.py .                             [ 96%]
2024-12-18T19:56:47.2414181Z awx/main/tests/functional/test_python_requirements.py s                  [ 96%]
2024-12-18T19:56:47.2446823Z awx/main/tests/functional/test_rbac_credential.py .                      [ 97%]
2024-12-18T19:56:47.2480853Z awx/conf/tests/test_env.py .                                             [ 97%]
2024-12-18T19:56:47.3424058Z awx/conf/tests/unit/test_fields.py ..................................... [ 98%]
2024-12-18T19:56:47.4401675Z ..................                                                       [ 98%]
2024-12-18T19:56:47.4811318Z awx/conf/tests/unit/test_registry.py ...............                     [ 99%]
2024-12-18T19:56:56.8176629Z awx/conf/tests/unit/test_settings.py ..........................          [100%]
2024-12-18T19:56:56.8177326Z 
2024-12-18T19:56:56.8177572Z =============================== warnings summary ===============================
2024-12-18T19:56:56.8178838Z ../var/lib/awx/venv/awx/lib64/python3.11/site-packages/_pytest/assertion/rewrite.py:184
2024-12-18T19:56:56.8181016Z   /var/lib/awx/venv/awx/lib64/python3.11/site-packages/_pytest/assertion/rewrite.py:184: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
2024-12-18T19:56:56.8182930Z     exec(co, module.__dict__)

@AlanCoding AlanCoding merged commit c015818 into ansible:devel Dec 18, 2024
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants