Hey All, getting this new, confusing error when ru...
# welcome
l
Hey All, getting this new, confusing error when running PyTest tests via
./pants test path/to:target
Copy code
9:56:22.55 [ERROR] 1 Exception encountered:

  ProcessExecutionFailure: Process 'Create base global Pytest coverage report.' failed with exit code 1.
stdout:
Can't read '__global_coverage__/pyproject.toml' without TOML support. Install with [toml] extra
Tried adding the following to my
pants.toml
to no avail:
Copy code
[pytest]

version = "pytest==7.2.1"
lockfile = "3rdparty/pytest_lockfile.txt"
args = ["-vv", '-s']
extra_requirements.add = [
    "toml",
    "pytest-cov",
]

[coverage-py]

version = "coverage==7.1.0"
global_report = true
report = ["xml", "html", "json", "console"]
output_dir="dist/coverage_reports/python"
lockfile = "3rdparty/coverage-py_lockfile.txt"
extra_requirements.add = ["toml"]
Setting
global_report = false
makes the error disappear
e
Pants doesn't support 7.x does it?
l
I do not know! That could certainly be the issue
I don’t see information about specific compatibility [in the pytest goal docs](https://www.pantsbuild.org/docs/python-test-goal#pytest-version-and-plugins)
r
e
But the proximal issue / solution is right there in the error message, ask for the toml extra
r
yeah
Copy code
[coverage-py]
version = "coverage[toml]~=7.0.5"
global_report = false
l
But the proximal issue / solution is right there in the error message, ask for the toml extra
I believe I’m doing that in the
pants.toml
snippet I pasted though, via the
extra_requirements.add
lines? Unless you mean via python extras syntax, so like
version = "coverage[toml]"
?
e
Yes.