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

23 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-05-16 22:20 +0000

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

2# _____ ____ _ _ ____ _ # 

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

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

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

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

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

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

9# Authors: # 

10# Patrick Lehmann # 

11# # 

12# License: # 

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

14# Copyright 2021-2025 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-2025, Electronic Design Automation Abstraction (EDA²)" 

37__license__ = "Apache License, Version 2.0" 

38__version__ = "0.16.0" 

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

40 

41from enum import Enum 

42from sys import version_info 

43from typing import List 

44 

45from pyTooling.Decorators import export 

46 

47 

48@export 

49class ReportException(Exception): 

50 # WORKAROUND: for Python <3.11 

51 # Implementing a dummy method for Python versions before 

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

53 __notes__: List[str] 

54 

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

56 try: 

57 self.__notes__.append(message) 

58 except AttributeError: 

59 self.__notes__ = [message] 

60 

61 

62@export 

63class Severity(Enum): 

64 Unknown = 0 

65 Debug = 5 

66 Verbose = 10 

67 Normal = 20 

68 Info = 25 

69 Warning = 50 

70 CriticalWarning = 55 

71 Error = 60 

72 Fatal = 70