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

Comment in unit test with invalid syntax breaks pre-compile #737

Closed
gone-for-coding opened this issue Sep 17, 2024 · 2 comments · Fixed by #738
Closed

Comment in unit test with invalid syntax breaks pre-compile #737

gone-for-coding opened this issue Sep 17, 2024 · 2 comments · Fixed by #738

Comments

@gone-for-coding
Copy link

SUMMARY

The comment aa8ddef#diff-40cad2763ec8aa722046788c29c9ef0f9dcfcbdcc5ca34cbaaaca2fbdbe4ed95R54-R56 should not be placed in an assert statement as it breaks pre-compilation with python -m compielall.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

tests/unit/plugins/modules/test_postgresql_user.py

ANSIBLE VERSION
not relevant
COLLECTION VERSION
# /usr/share/ansible/collections/ansible_collections
Collection           Version
-------------------- -------
community.postgresql 3.6.0
CONFIGURATION
none
OS / ENVIRONMENT
root@ee92370aee13:/code# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

root@ee92370aee13:/code# python --version
Python 3.12.5
STEPS TO REPRODUCE

Install version 3.6.0 of the collection and pre-compile all files.

ansible-galaxy collection install --force --collections-path /usr/share/ansible/collections community.postgresql
python -m compileall /usr/share/ansible
echo $?
EXPECTED RESULTS

No errors.

ACTUAL RESULTS
Compiling '/usr/share/ansible/collections/ansible_collections/community/postgresql/tests/unit/plugins/modules/test_postgresql_user.py'...
***   File "/usr/share/ansible/collections/ansible_collections/community/postgresql/tests/unit/plugins/modules/test_postgresql_user.py", line 55
    # TODO the following two lines were added because the assertion above fails
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax
Listing '/usr/share/ansible/collections/ansible_collections/community/postgresql/tests/utils'...
@Andersson007
Copy link
Collaborator

@gone-for-coding hello, thanks a lot for reporting the issue! I've just publish 3.6.1 with the comment moved out from the wrong position, please upgrade and try again, thanks

@gone-for-coding
Copy link
Author

@Andersson007 wow that was a quick fix. Everything looking good now. Thanks a lot!

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

Successfully merging a pull request may close this issue.

2 participants