boxed / mutmut

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

I can't show the results #330

Closed pomponchik closed 3 weeks ago

pomponchik commented 1 month ago

Hi! I use mutmut in my project. When I run the mutmut html command, I get the following result in my console:

% mutmut html
Traceback (most recent call last):
  File "/Users/pomponchik/Desktop/Projects/suby/venv/bin/mutmut", line 8, in <module>
    sys.exit(climain())
             ^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/mutmut/__init__.py", line 901, in wrapper
    f(*args, **kwargs)
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/mutmut/__main__.py", line 235, in html
    create_html_report(dict_synonyms)
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/mutmut/cache.py", line 88, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in create_html_report
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/core.py", line 519, in new_func
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/mutmut/cache.py", line 264, in create_html_report
    mutants = list(select(x for x in Mutant))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/core.py", line 5560, in select
    return make_query(args, frame_depth=cut_traceback_depth+1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/core.py", line 5546, in make_query
    tree, external_names, cells = decompile(gen)
                                  ^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/decompiling.py", line 43, in decompile
    decompiler = Decompiler(codeobject)
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/decompiling.py", line 162, in __init__
    decompiler.decompile()
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/decompiling.py", line 276, in decompile
    x = method(*arg)
        ^^^^^^^^^^^^
TypeError: Decompiler.YIELD_VALUE() takes 1 positional argument but 2 were given

Steps to reproduce the problem:

  1. Clone my repository.
  2. Come into the project directory, create a virtual environment and activate it, run the command pip3 install -r requirements'.txt.
  3. Run mutmut run.
  4. Run mutmut html.

About my system:

  1. Python version - Python 3.12.4.
  2. OS - MacOS 14.1 (23B2073)
  3. Lists of packages into the venv:
Package            Version
------------------ --------
build              0.9.0
cantok             0.0.22
certifi            2024.7.4
charset-normalizer 3.3.2
click              8.1.7
coverage           7.2.7
docutils           0.21.2
emptylog           0.0.7
full-match         0.0.1
glob2              0.7
idna               3.7
importlib_metadata 8.0.0
iniconfig          2.0.0
jaraco.classes     3.4.0
jaraco.context     5.3.0
jaraco.functools   4.0.1
junit-xml          1.9
keyring            25.2.1
markdown-it-py     3.0.0
mdurl              0.1.2
more-itertools     10.3.0
mutmut             2.4.4
mypy               1.4.1
mypy-extensions    1.0.0
nh3                0.2.18
packaging          24.1
parso              0.8.4
pep517             0.13.1
pip                24.0
pkginfo            1.11.1
pluggy             1.5.0
pony               0.7.17
printo             0.0.2
Pygments           2.18.0
pytest             7.4.2
readme_renderer    44.0
requests           2.32.3
requests-toolbelt  1.0.0
rfc3986            2.0.0
rich               13.7.1
ruff               0.0.290
six                1.16.0
toml               0.10.2
twine              4.0.2
typing_extensions  4.12.2
urllib3            2.2.2
zipp               3.19.2
pomponchik commented 1 month ago

And the output of the mutmut results:

% mutmut results
To apply a mutant on disk:
    mutmut apply <id>

To show a mutant:
    mutmut show <id>

Traceback (most recent call last):
  File "/Users/pomponchik/Desktop/Projects/suby/venv/bin/mutmut", line 8, in <module>
    sys.exit(climain())
             ^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/mutmut/__main__.py", line 152, in results
    print_result_cache()
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/mutmut/cache.py", line 88, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in print_result_cache
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/core.py", line 519, in new_func
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/mutmut/cache.py", line 183, in print_result_cache
    print_stuff('Timed out ⏰', select(x for x in Mutant if x.status == BAD_TIMEOUT))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/core.py", line 5560, in select
    return make_query(args, frame_depth=cut_traceback_depth+1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/core.py", line 5546, in make_query
    tree, external_names, cells = decompile(gen)
                                  ^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/decompiling.py", line 43, in decompile
    decompiler = Decompiler(codeobject)
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/decompiling.py", line 160, in __init__
    decompiler.get_instructions()
  File "/Users/pomponchik/Desktop/Projects/suby/venv/lib/python3.12/site-packages/pony/orm/decompiling.py", line 216, in get_instructions
    arg = [cmp_op[oparg]]
           ~~~~~~^^^^^^^
IndexError: tuple index out of range