• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 19015773527

02 Nov 2025 05:33PM UTC coverage: 17.872% (-62.4%) from 80.3%
19015773527

Pull #22816

github

web-flow
Merge a12d75757 into 6c024e162
Pull Request #22816: Update Pants internal Python to 3.14

4 of 5 new or added lines in 3 files covered. (80.0%)

28452 existing lines in 683 files now uncovered.

9831 of 55007 relevant lines covered (17.87%)

0.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.67
/src/python/pants/engine/internals/nodes.py
1
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
1✔
5

6
from dataclasses import dataclass
1✔
7
from typing import Any, Optional
1✔
8

9

10
@dataclass(frozen=True)
1✔
11
class Return:
1✔
12
    """Indicates that a Node successfully returned a value."""
13

14
    value: Any
1✔
15

16

17
_Frame = tuple[str, Optional[str]]
1✔
18

19

20
@dataclass(frozen=True)
1✔
21
class Throw:
1✔
22
    """Indicates that a Node should have been able to return a value, but failed."""
23

24
    exc: Exception
1✔
25
    python_traceback: str | None = None
1✔
26
    engine_traceback: tuple[_Frame, ...] = ()
1✔
27

28
    def _render_frame(self, frame: _Frame, include_trace_on_error: bool) -> str | None:
1✔
29
        """Renders either only the description (if set), or both the name and description."""
UNCOV
30
        name, desc = frame
×
31

UNCOV
32
        if include_trace_on_error:
×
UNCOV
33
            return f"{name}\n    {desc or '..'}"
×
UNCOV
34
        elif desc:
×
35
            return f"{desc}"
×
36
        else:
UNCOV
37
            return None
×
38

39
    def render(self, include_trace_on_error: bool) -> str:
1✔
UNCOV
40
        all_rendered_frames = [
×
41
            self._render_frame(frame, include_trace_on_error)
42
            for frame in reversed(self.engine_traceback)
43
        ]
UNCOV
44
        rendered_frames = [f for f in all_rendered_frames if f]
×
UNCOV
45
        engine_traceback_str = ""
×
UNCOV
46
        if rendered_frames:
×
UNCOV
47
            sep = "\n  in "
×
UNCOV
48
            engine_traceback_str = "Engine traceback:" + sep + sep.join(rendered_frames) + "\n\n"
×
UNCOV
49
        if include_trace_on_error:
×
UNCOV
50
            python_traceback_str = f"{self.python_traceback}" if self.python_traceback else ""
×
51
        else:
UNCOV
52
            python_traceback_str = f"{type(self.exc).__name__}: {str(self.exc)}"
×
UNCOV
53
        return f"{engine_traceback_str}{python_traceback_str}"
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc