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

pantsbuild / pants / 18252174847

05 Oct 2025 01:36AM UTC coverage: 43.382% (-36.9%) from 80.261%
18252174847

push

github

web-flow
run tests on mac arm (#22717)

Just doing the minimal to pull forward the x86_64 pattern.

ref #20993

25776 of 59416 relevant lines covered (43.38%)

1.3 hits per line

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

86.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
3✔
5

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

9

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

14
    value: Any
3✔
15

16

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

19

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

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

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

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

39
    def render(self, include_trace_on_error: bool) -> str:
3✔
40
        all_rendered_frames = [
3✔
41
            self._render_frame(frame, include_trace_on_error)
42
            for frame in reversed(self.engine_traceback)
43
        ]
44
        rendered_frames = [f for f in all_rendered_frames if f]
3✔
45
        engine_traceback_str = ""
3✔
46
        if rendered_frames:
3✔
47
            sep = "\n  in "
3✔
48
            engine_traceback_str = "Engine traceback:" + sep + sep.join(rendered_frames) + "\n\n"
3✔
49
        if include_trace_on_error:
3✔
50
            python_traceback_str = f"{self.python_traceback}" if self.python_traceback else ""
3✔
51
        else:
52
            python_traceback_str = f"{type(self.exc).__name__}: {str(self.exc)}"
×
53
        return f"{engine_traceback_str}{python_traceback_str}"
3✔
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