Skip to content

Option [tool.coverage.run]source is not a list: 'mypy' #16255

Closed

Description

@mtelka

When running tests for mypy 1.6.0 I see errors like:

py39: commands[0]> python -m pytest
Traceback (most recent call last):
  File "/usr/lib/python3.9/vendor-packages/coverage/config.py", line 308, in from_file
    was_set = self._set_attr_from_config_option(cp, *option_spec)
  File "/usr/lib/python3.9/vendor-packages/coverage/config.py", line 448, in _set_attr_from_config_option
    setattr(self, attr, method(section, option))
  File "/usr/lib/python3.9/vendor-packages/coverage/tomlconfig.py", line 187, in getlist
    _, values = self._get_list(section, option)
  File "/usr/lib/python3.9/vendor-packages/coverage/tomlconfig.py", line 182, in _get_list
    values = self._check_type(name, option, values, list, None, "a list")
  File "/usr/lib/python3.9/vendor-packages/coverage/tomlconfig.py", line 170, in _check_type
    raise ValueError(
ValueError: Option [tool.coverage.run]source is not a list: 'mypy'

The fix seems to be obvious:

--- mypy-1.6.0/pyproject.toml.orig
+++ mypy-1.6.0/pyproject.toml
@@ -105,13 +105,13 @@

 [tool.coverage.run]
 branch = true
-source = "mypy"
+source = ["mypy"]
 parallel = true

 [tool.coverage.report]
 show_missing = true
 skip_covered = true
-omit = 'mypy/test/*'
+omit = ['mypy/test/*']
 exclude_lines = [
   '\#\s*pragma: no cover',
   '^\s*raise AssertionError\b',

Activity

  1. AlexWaygood commented on Oct 13, 2023

    @AlexWaygood
    Member

    The fix seems to be obvious:

    yep, that seems correct. It was a mistake I made in #15548.

  2. added a commit that references this issue on Oct 13, 2023
    fbc48af
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions