cookiecutter-pypackage icon indicating copy to clipboard operation
cookiecutter-pypackage copied to clipboard

pytest failing with AssertionError when default config is changed

Open mazzma12 opened this issue 3 years ago • 0 comments

  • 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 

mazzma12 avatar Oct 17 '21 21:10 mazzma12