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

earwig / mwparserfromhell / 15949141982

28 Jun 2025 11:18PM UTC coverage: 98.886% (-0.3%) from 99.204%
15949141982

push

github

earwig
Fix a failing test

3106 of 3141 relevant lines covered (98.89%)

9.85 hits per line

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

95.45
/src/mwparserfromhell/nodes/text.py
1
# Copyright (C) 2012-2025 Ben Kurtovic <ben.kurtovic@gmail.com>
2
#
3
# Permission is hereby granted, free of charge, to any person obtaining a copy
4
# of this software and associated documentation files (the "Software"), to deal
5
# in the Software without restriction, including without limitation the rights
6
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
# copies of the Software, and to permit persons to whom the Software is
8
# furnished to do so, subject to the following conditions:
9
#
10
# The above copyright notice and this permission notice shall be included in
11
# all copies or substantial portions of the Software.
12
#
13
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
# SOFTWARE.
20

21
from __future__ import annotations
10✔
22

23
from typing import TYPE_CHECKING, Any, Callable
10✔
24

25
from ._base import Node
10✔
26

27
if TYPE_CHECKING:
10✔
28
    from ..wikicode import Wikicode
×
29

30
__all__ = ["Text"]
10✔
31

32

33
class Text(Node):
10✔
34
    """Represents ordinary, unformatted text with no special properties."""
35

36
    def __init__(self, value: Any):
10✔
37
        super().__init__()
10✔
38
        self.value = value
10✔
39

40
    def __str__(self) -> str:
10✔
41
        return self.value
10✔
42

43
    def __strip__(self, **kwargs: Any) -> str:
10✔
44
        return str(self)
10✔
45

46
    def __showtree__(
10✔
47
        self,
48
        write: Callable[[str], None],
49
        get: Callable[[Wikicode], None],
50
        mark: Callable[[], None],
51
    ) -> None:
52
        write(str(self).encode("unicode_escape").decode("utf8"))
10✔
53

54
    @property
10✔
55
    def value(self) -> str:
10✔
56
        """The actual text itself."""
57
        return self._value
10✔
58

59
    @value.setter
10✔
60
    def value(self, newval: Any) -> None:
10✔
61
        self._value = str(newval)
10✔
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