Mutation testing tool for Python 2.7
Asked Answered
H

2

16

While writing another unittest in Python and after learning about multiple testing methods, I got curious how many mutants would be killed if I performed mutation testing on my code.

The problem is that I use Python 2.7 and the only tool I found is MutPy and it's for Python 3.x.

Does anyone know about any (stable and supported) tool for mutation testing for Python 2.7?

Hypothesis answered 20/9, 2014 at 23:48 Comment(6)
This doesn't help you in any way, but I just wanted to say: this week I've seen 4 questions from people who can't use a library because it's 3.x-only, and only 2 who can't use a library because it's 2.x-only, and one of those 2 was wrong…Letsou
Anyway, a quick search at PyPI turns up multiple candidates. Have you looked at all of them?Letsou
Sorry for late answer and thank you for comment. Yes, I've searched for a tool at PyPI and I didn't found anything matching my needs, that's why I'm asking here. One found tool is too simple - mutant 0.1, one is an alpha version - pymutester 0.1.0, one (as I mentioned in my question) is for Python 3.x. The rest of the list have no strict connection with mutation testing.Hypothesis
I assumed that 4 other people would quickly vote to close, so I wouldn't have to explain in a comment, but since that hasn't happened: "library-shopping" questions like this aren't appropriate for Stack Overflow. It's not that they're bad questions, it's just that they don't fit the way SO works. Software Recommendations may be a good fit, but I can't promise that. Mailing lists and discussion forums are likely to be helpful.Letsou
Ok, I'll ask there, thank you.Hypothesis
If you are still looking for it, we have xmutant for Python 2.7. Still alpha, but should be better than other choices.Hypotonic
M
3

Mutmut works for python 2.7 as well as python 3.6. It's also super easy to get started with and supports all test runners that can return an operating system exit code.

EDIT: Mutmut has now dropped python 2.7 support. But older versions still work on python 2.7 of course!

Melantha answered 2/8, 2018 at 19:15 Comment(0)
E
1

This is a library for Python2: https://github.com/sk-/elcap

Endymion answered 16/3, 2015 at 22:21 Comment(1)
Thanks for answering but I can't see any activity since 2012. And (according to their README) it's "This is an early release".Hypothesis

© 2022 - 2024 — McMap. All rights reserved.