Pass parameters to pre/post mutation hooks
Hi @boxed,
I am writing a mutmut plugin to
- find duplicated tests (ones that always fails together)
- 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?
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.
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%]
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.