0

I created a project that follows the example in MutPy's README file.

However, when I run mut.py --target calculator --unit-test test_calculator -m, it just opens mut.py instead of actually running MutPy.

The file has the following content:

#!c:\users\admin\appdata\local\programs\python\python39\python.exe

import sys
from mutpy import commandline

if __name__ == '__main__':
    commandline.main(sys.argv)

The README doesn't mention any other configurations that need to be done and says that it should be compatible with Python 3.3+ (I'm on Python 3.9.6).

Is there something I'm doing wrong?

Floating Sunfish
  • 4,920
  • 5
  • 29
  • 48

1 Answers1

1

Are you runing this from cmd.exe? If so try:

python.exe mut.py --target calculator --unit-test test_calculator -m

Note that you need python in your PATH Variable.

It will probably also work if you set python as the default application for .py files.

maxbit89
  • 748
  • 1
  • 11
  • 31
  • Thanks for the reply. While I have gotten MutPy to run, it's reporting some errors. I'll see if going to a lower version of Python will resolve the issue (but needing to do so might be a dealbreaker for us). It seems that MutPy is a bit outdated, so I'm also considering looking at other mutation testing tools if possible. I was originally looking at mutmut, but it tends to stop running after a while due to some threading issues. – Floating Sunfish Jul 23 '21 at 04:08
  • Also, I had to add the path to `mut.py` in the command: `python.exe C:\Users\Admin\AppData\Local\Programs\Python\Python39\Scripts\mut.py --target calculator --unit-test test_calculator -m` – Floating Sunfish Jul 23 '21 at 04:11