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

Test fail when argument order are reversed in config #670

Open
mazzma12 opened this issue Aug 28, 2022 · 5 comments
Open

Test fail when argument order are reversed in config #670

mazzma12 opened this issue Aug 28, 2022 · 5 comments

Comments

@mazzma12
Copy link

mazzma12 commented Aug 28, 2022

  • Date you used Cookiecutter PyPackage: 28 August 2022
  • Cookiecutter version used, if any: 1.7.3
  • Python version, if any: 3.9
  • Operating System: Ubuntu 22.04

Description

I am trying to add new tests and I noticed that swapping the argument order in the init config will let the current test fail. Do you know why ? I don't understand since it does not look than anything is built based on argument order (to me)

What I Did

sed -i 's/"Click", "Argparse"/"Argparse", "Click"/g' ./cookiecutter.json

Then running the test produce 2 tests to fail:

self = <click.testing.CliRunner object at 0x7f77df476e90>, cli = <function main at 0x7f77df51ca60>

    def get_default_prog_name(self, cli: "BaseCommand") -> str:
        """Given a command object it will return the default program name
        for it.  The default is the `name` attribute or ``"root"`` if not
        set.
        """
>       return cli.name or "root"
E       AttributeError: 'function' object has no attribute 'name'

../../../.pyenv/versions/cs310/lib/python3.10/site-packages/click/testing.py:195: AttributeError
=============================================================== short test summary info ===============================================================
FAILED tests/test_bake_project.py::test_bake_with_console_script_cli - AttributeError: 'function' object has no attribute 'name'
FAILED tests/test_bake_project.py::test_bake_with_argparse_console_script_cli - AttributeError: 'function' object has no attribute 'name
@audreyfeldroy
Copy link
Owner

@mazzma12 thanks a ton for catching this, and for the detailed issue report and PR 🙏

@audreyfeldroy
Copy link
Owner

@CodiumAI-Agent /describe

@audreyfeldroy
Copy link
Owner

@CodiumAI-Agent /ask What do you mean by handle the case sensitivity issue within the code itself?

@mazzma12
Copy link
Author

@mazzma12 thanks a ton for catching this, and for the detailed issue report and PR 🙏

You welcome ! (Silently watching AI at work 😄 )

1 similar comment
@mazzma12
Copy link
Author

@mazzma12 thanks a ton for catching this, and for the detailed issue report and PR 🙏

You welcome ! (Silently watching AI at work 😄 )

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

No branches or pull requests

2 participants