Support python 3.10+
I'm using mutmut in my work projects with python 3.10 and its working except for a single project that we are using the "new" syntax of match-case (PEP 634). In this case, mutmut broke and return 100% of mutants killeds
There's any planning to add full suport for python 3.10?
Blocked by https://github.com/davidhalter/parso/issues/138
While waiting for the full support of Python 3.10, is there any recommended workaround that could be used for projects employing the match-case syntax? Any tips would be greatly appreciated.
Sorry, I don't really have anything to say to that. Extracting code you need to be mutation tested and testing it in a separate project is one way at least.. not great but 🤷
Hello there! Any news?
Read the linked issues for parso
Last comment was 2 years ago. It looks like nobody cares about this problem. Maybe change the parser? For example, to libcst?
Yea, that's one way to go for sure. I switched AST library for mutmut once before, and that wasn't as hard as one might expect. I'm very open to PRs, but I don't have much time for this myself.
I've also thought about using whatever Ruff uses, or whatever black uses...
FYI, there seems to be another issue which I've uncovered coming from parso. I'm not sure if it's the same or not, so please let me know if I should open up a new issue, instead.
This seems to be a parso problem with import asyncio:
$ mutmut run
- Mutation testing starting -
These are the steps:
1. A full test suite run will be made to make sure we
can run the tests successfully and we know how long
it takes (to detect infinite loops for example)
2. Mutants will be generated and checked
Results are stored in .mutmut-cache.
Print found mutants with `mutmut results`.
Legend for output:
🎉 Killed mutants. The goal is for everything to end up in this bucket.
⏰ Timeout. Test suite took 10 times as long as the baseline so were killed.
🤔 Suspicious. Tests took a long time, but not long enough to be fatal.
🙁 Survived. This means your tests need to be expanded.
🔇 Skipped. Skipped.
mutmut cache is out of date, clearing it...
1. Running tests without mutations
⠸ Running...Done
Failed to parse app/cli/commands/relay_events/relay_handlers.py. Internal error from parso follows.
----------------------------------
Traceback (most recent call last):
File "/virtualenvs/service-f1pOEzwg-py3.12/lib/python3.12/site-packages/parso/parser.py", line 180, in _add_token
plan = stack[-1].dfa.transitions[transition]
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: <PythonTokenTypes.NAME: TokenType(NAME)>
During handling of the above exception, another exception occurred:
SNIP
RuntimeError: Failed while creating mutations for app/cli/commands/relay_events/relay_handlers.py, for line "import asyncio"
Is this something new which needs a new issue or is this related to the same parso issue above?