boxed / mutmut

Mutation testing system
https://mutmut.readthedocs.io
BSD 3-Clause "New" or "Revised" License
925 stars 112 forks source link

Pass parameters to pre/post mutation hooks #122

Closed sobolevn closed 2 weeks ago

sobolevn commented 5 years ago

Hi @boxed,

I am writing a mutmut plugin to

  1. find duplicated tests (ones that always fails together)
  2. find useless tests (ones that never fail)

To achieve this I am using --post-mutation hook. But, it currently lacks any parameters. And execution code / execution traceback might be very useful.

It can be simple sys.argv data. Or environment variables.

What do you think?

boxed commented 5 years ago

What do you mean by "execution code / execution traceback"?

I think I like environment variables more because then they can be named in a nice way. But that's not a super strong argument.

sobolevn commented 5 years ago

I mean these lines:

============================= test session starts ==============================
platform linux -- Python 3.6.3, pytest-4.4.1, py-1.8.0, pluggy-0.9.0
Using --randomly-seed=1557169438
rootdir: /home/travis/build/wemake-services/wemake-python-styleguide, inifile: setup.cfg
plugins: randomly-3.0.0, cov-2.7.1
collected 8602 items
tests/test_visitors/test_ast/test_conditions/test_negated_conditions.py . [  0%]
...............                                                          [  0%]
tests/test_visitors/test_ast/test_naming/test_naming_rules/test_wrong_names.py . [  0%]
........................................................................ [  1%]
........................................................................ [  1%]
boxed commented 5 years ago

Ah, so the output of the test run, gotcha. Yea in that case it has to be an environment variable I think because it's multi line.

boxed commented 2 weeks ago

I just released mutmut 3, which is a big rewrite. I believe this issue no longer applies anymore. Feel free to reopen it if it still exists.