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

SPF-OST / pytrnsys_gui / 16883947425

11 Aug 2025 03:03PM UTC coverage: 67.786% (-0.07%) from 67.858%
16883947425

push

github

web-flow
Merge pull request #602 from SPF-OST/crash-without-settings

Don't crash if no settings available.

16 of 45 new or added lines in 5 files covered. (35.56%)

9 existing lines in 4 files now uncovered.

10460 of 15431 relevant lines covered (67.79%)

0.68 hits per line

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

0.0
/trnsysGUI/tracing.py
UNCOV
1
import trace as _trc
×
UNCOV
2
import typing as _tp
×
3
import abc as _abc
×
4
import logging as _log
×
5
import sys as _sys
×
6

7
_TCo = _tp.TypeVar("_TCo")
×
8

9
__all__ = ["createTracer", "TracerBase"]
×
10

11
_logger = _log.getLogger("root")
×
12

13

14
class TracerBase(_abc.ABC):
×
15
    @_abc.abstractmethod
16
    def run(self, func: _tp.Callable[[], _TCo]) -> _TCo:
17
        pass
18

19

20
class _DummyTracer(TracerBase):
×
21
    def run(self, func: _tp.Callable[[], _TCo]) -> _TCo:
×
22
        return func()
×
23

24

25
class _Tracer(TracerBase):
×
26
    def __init__(self):
×
27
        ignoredirs = [_sys.prefix]
×
28
        self._trace = _trc.Trace(
×
29
            count=False, trace=True, timing=True, ignoredirs=ignoredirs
30
        )
31

32
    def run(self, func: _tp.Callable[[], _TCo]) -> _TCo:
×
33
        return self._trace.runfunc(func)
×
34

35

36
def createTracer(shallTrace: bool) -> TracerBase:
×
37
    if not shallTrace:
×
38
        _logger.debug("Tracing is DISABLED.")
×
39
        return _DummyTracer()
×
40

41
    _logger.info("Tracing is ENABLED.")
×
42
    return _Tracer()
×
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