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

Hekxsler / pudding / 26160450240

20 May 2026 11:43AM UTC coverage: 92.319% (-0.9%) from 93.254%
26160450240

Pull #5

github

web-flow
[tests]: adjust tests to new error base class
Pull Request #5: Feature/specifiy output

1286 of 1393 relevant lines covered (92.32%)

0.92 hits per line

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

88.89
pudding/datatypes/data.py
1
"""Base class for data types."""
2

3
import re
1✔
4

5
from pudding.exceptions import TypeError
1✔
6

7

8
class Data:
1✔
9
    """Class representing a data value.
10

11
    :var regex: Regex matching the data type as a string.
12
    """
13

14
    regex: str
15

16
    def __init__(self, line: int, value: str) -> None:
1✔
17
        """Init for Data class.
18

19
        :param line: Line number of this data.
20
        :param value: Value of the data object.
21
        """
22
        if not re.fullmatch(self.regex, value):
1✔
23
            raise TypeError(f"Value is not of type {self.__class__.__name__}")
×
24
        self.line = line
1✔
25
        self.value = value
1✔
26
        self.re_pattern = re.escape(self.value)
1✔
27

28
    def __str__(self) -> str:
29
        """Value as a string."""
30
        return self.value
31

32
    def __repr__(self) -> str:
33
        """Return string representation of this object."""
34
        return f"<{self.__class__.__name__} value={repr(self.value)}>"
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

© 2026 Coveralls, Inc