When a new project is generated, the pytest will always fail!
cookies = <pytest_cookies.Cookies object at 0x7f723681c710>
def test_run_flake8(cookies):
result = cookies.bake(extra_context={'project_slug': 'flake8_compat'})
with inside_dir(str(result.project)):
> assert os.subprocess.check_call(['flake8']) == 0
E AttributeError: module 'os' has no attribute 'subprocess'
tests/test_bake_project.py:30: AttributeError
Error
When a new project is generated, the pytest will always fail!
An online error example: https://travis-ci.org/yanqd0/cookiecutter-serious-pycli/builds/447092846
Solution
The subprocess has become an independent module for a long time.
By the way, the
check_call
will always return0
, if it is not crashed. So I delete the unnecessaryassert
.Test
I really don't know how to test this with Mamba, so the regression test is missing.