mutmut icon indicating copy to clipboard operation
mutmut copied to clipboard

feat: allow supplying options on cli tool

Open souradeep-das opened this issue 4 months ago • 7 comments

Overview

Allow supplying paths-to-mutate (as comma separated values), tests-dir, and debug 'options' through the cli tool

Example:

mutmut --paths-to-mutate <path1,path2> --tests-dir <path> --debug run

souradeep-das avatar Aug 13 '25 15:08 souradeep-das

I don't think this is a good idea. Mutmut 2 had it and I consider that a mistake.

boxed avatar Aug 13 '25 16:08 boxed

Thanks for the feedback! Any particular context/reasons why this could be bad?

souradeep-das avatar Aug 13 '25 16:08 souradeep-das

Just that the conf is annoying to get right and then you forget about it and your life sucks :)

And it won't work with the interactive UI either.

boxed avatar Aug 13 '25 17:08 boxed

How would you recommend filtering out tests? Some of ours run extremely long and aren't really necessary to run for every mutation.

SamWilsn avatar Aug 15 '25 14:08 SamWilsn

Ideally you would keep the mutations directory between runs, and then mutmut will automatically know which mutants to check. You can also set the stack depth to something lower to make it accept fewer tests.

boxed avatar Aug 16 '25 08:08 boxed

Sorry, not sure I follow. If I have a test function, test_really_really_long_running, how do I exclude it from the tests mutmut runs? It doesn't have a particularly deep stack compared to other tests, just a lot more iterations. In pytest, we use -m "not slow".

@pytest.mark.slow
def test_really_really_long_running():
   ...

SamWilsn avatar Aug 18 '25 14:08 SamWilsn

https://github.com/boxed/mutmut/issues/423 see the discussion there. Options in the config makes sense to me.

boxed avatar Aug 18 '25 15:08 boxed