Coverage for pyEDAA/Reports/__init__.py: 100%

26 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-07-20 21:18 +0000

1# ==================================================================================================================== # 

2# _____ ____ _ _ ____ _ # 

3# _ __ _ _| ____| _ \ / \ / \ | _ \ ___ _ __ ___ _ __| |_ ___ # 

4# | '_ \| | | | _| | | | |/ _ \ / _ \ | |_) / _ \ '_ \ / _ \| '__| __/ __| # 

5# | |_) | |_| | |___| |_| / ___ \ / ___ \ _| _ < __/ |_) | (_) | | | |_\__ \ # 

6# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)_| \_\___| .__/ \___/|_| \__|___/ # 

7# |_| |___/ |_| # 

8# ==================================================================================================================== # 

9# Authors: # 

10# Patrick Lehmann # 

11# # 

12# License: # 

13# ==================================================================================================================== # 

14# Copyright 2021-2026 Electronic Design Automation Abstraction (EDA²) # 

15# # 

16# Licensed under the Apache License, Version 2.0 (the "License"); # 

17# you may not use this file except in compliance with the License. # 

18# You may obtain a copy of the License at # 

19# # 

20# http://www.apache.org/licenses/LICENSE-2.0 # 

21# # 

22# Unless required by applicable law or agreed to in writing, software # 

23# distributed under the License is distributed on an "AS IS" BASIS, # 

24# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 

25# See the License for the specific language governing permissions and # 

26# limitations under the License. # 

27# # 

28# SPDX-License-Identifier: Apache-2.0 # 

29# ==================================================================================================================== # 

30# 

31""" 

32Various report abstract data models and report format converters. 

33""" 

34__author__ = "Patrick Lehmann" 

35__email__ = "Paebbels@gmail.com" 

36__copyright__ = "2021-2026, Electronic Design Automation Abstraction (EDA²)" 

37__license__ = "Apache License, Version 2.0" 

38__version__ = "0.17.4" 

39__keywords__ = ["Reports", "Abstract Model", "Data Model", "Unit Testing", "Testcase", "Testsuite", "OSVVM", "YAML", "XML"] 

40__project_url__ = "https://github.com/edaa-org/pyEDAA.Reports" 

41__documentation_url__ = "https://edaa-org.github.io/pyEDAA.Reports" 

42__issue_tracker_url__ = "https://GitHub.com/edaa-org/pyEDAA.Reports/issues" 

43 

44from enum import Enum 

45from sys import version_info 

46from typing import List 

47 

48from pyTooling.Decorators import export 

49 

50 

51@export 

52class ReportException(Exception): 

53 # WORKAROUND: for Python <3.11 

54 # Implementing a dummy method for Python versions before 

55 if version_info < (3, 11): # pragma: no cover 

56 __notes__: List[str] 

57 

58 def add_note(self, message: str) -> None: 

59 try: 

60 self.__notes__.append(message) 

61 except AttributeError: 

62 self.__notes__ = [message] 

63 

64 

65@export 

66class Severity(Enum): 

67 Unknown = 0 

68 Debug = 5 

69 Verbose = 10 

70 Normal = 20 

71 Info = 25 

72 Warning = 50 

73 CriticalWarning = 55 

74 Error = 60 

75 Fatal = 70