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

pytest failing with AssertionError when default config is changed #627

Open
mazzma12 opened this issue Oct 17, 2021 · 0 comments
Open

pytest failing with AssertionError when default config is changed #627

mazzma12 opened this issue Oct 17, 2021 · 0 comments

Comments

@mazzma12
Copy link

  • Date you used Cookiecutter PyPackage: 2021-10-17
  • Cookiecutter version used, if any:
  • Python version, if any: 3.9.7
  • Operating System: Ubuntu 20.04

Description

Just changed the config line in cookiecutter.json to "use_pytest": "y" and the pytest failed with an AssertionError

================================================ test session starts =================================================
platform linux -- Python 3.9.7, pytest-5.3.1, py-1.10.0, pluggy-0.13.1
rootdir: /home/matthieu/git/mazzma12/cookiecutter-pypackage, inifile: pytest.ini, testpaths: tests/
plugins: cookies-0.5.1
collected 19 items                                                                                                   

tests/test_bake_project.py ...........F.......                                                                 [100%]

====================================================== FAILURES ======================================================
_______________________________________________ test_not_using_pytest ________________________________________________

cookies = <pytest_cookies.plugin.Cookies object at 0x7f576adc48b0>

>   ???
E   assert 'import unittest' in '#!/usr/bin/env python\n\n"""Tests for `python_boilerplate` package."""\n\nimport pytest\n\nfrom click.testing import ...'])\n    assert help_result.exit_code == 0\n    assert \'--help  Show this message and exit.\' in help_result.output\n'
E    +  where '#!/usr/bin/env python\n\n"""Tests for `python_boilerplate` package."""\n\nimport pytest\n\nfrom click.testing import ...'])\n    assert help_result.exit_code == 0\n    assert \'--help  Show this message and exit.\' in help_result.output\n' = <built-in method join of str object at 0x7f576cf3d670>(['#!/usr/bin/env python\n', '\n', '"""Tests for `python_boilerplate` package."""\n', '\n', 'import pytest\n', '\n', ...])
E    +    where <built-in method join of str object at 0x7f576cf3d670> = ''.join

/home/matthieu/git/playground/test/cookiecutter-pypackage/tests/test_bake_project.py:234: AssertionError
============================================ 1 failed, 18 passed in 9.43s ============================================

What I Did

pytest 
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

1 participant