Is it better to invoke hatch as a subprocess or programmatically from within a hatch command itself? #1573
-
To add some context to my question: I have a cookiecutter template that I want to test. So the tests instantiate the template and create a project. Then, I run all the tests that come with the template in that project. At the moment, I do this by running tox as a subprocess in the test case itself. I'm in the process of replacing tox with hatch environments which got me wondering if I can also call, for example, hatch test, programmatically from within the test case. Or maybe that is a bad idea because the nested hatch calls would be confusing configuration/environment wise? I appreciate any insights. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 14 replies
-
I got it somewhat working, i.e., it seems fine on POSIX but fails on Windows. See my cookiecutter project https://github.com/Midnighter/cookiecutter-python-package and failing Windows tests https://github.com/Midnighter/cookiecutter-python-package/actions/runs/9720089690/job/26830982226 |
Beta Was this translation helpful? Give feedback.
oh on non-Windows systems when using
shell=True
you must always pass the command as a string, Windows in all cases works as a list of strings