orionis 0.432.0__py3-none-any.whl → 0.434.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. orionis/app.py +17 -0
  2. orionis/metadata/framework.py +1 -1
  3. orionis/support/entities/base.py +18 -37
  4. orionis/support/facades/console.py +3 -9
  5. orionis/support/facades/dumper.py +3 -9
  6. orionis/support/facades/logger.py +3 -9
  7. orionis/support/facades/path_resolver.py +3 -10
  8. orionis/support/facades/progress_bar.py +3 -10
  9. orionis/support/facades/testing.py +4 -10
  10. orionis/support/facades/workers.py +4 -9
  11. orionis/support/formatter/exceptions/contracts/parser.py +10 -7
  12. orionis/support/formatter/exceptions/parser.py +28 -26
  13. orionis/support/formatter/serializer.py +12 -5
  14. orionis/support/patterns/singleton/meta.py +17 -21
  15. orionis/support/standard/contracts/std.py +25 -24
  16. orionis/support/standard/exceptions/value.py +2 -2
  17. orionis/support/standard/std.py +26 -24
  18. orionis/support/wrapper/dot_dict.py +16 -51
  19. orionis/test/cases/asynchronous.py +17 -81
  20. orionis/test/cases/synchronous.py +17 -73
  21. orionis/test/contracts/dumper.py +17 -21
  22. orionis/test/contracts/kernel.py +5 -12
  23. orionis/test/contracts/logs.py +16 -21
  24. orionis/test/contracts/printer.py +70 -8
  25. orionis/test/contracts/render.py +7 -13
  26. orionis/test/contracts/test_result.py +58 -27
  27. orionis/test/contracts/unit_test.py +18 -18
  28. orionis/test/core/unit_test.py +162 -519
  29. orionis/test/entities/result.py +49 -21
  30. orionis/test/enums/status.py +11 -17
  31. orionis/test/exceptions/config.py +4 -8
  32. orionis/test/exceptions/failure.py +2 -18
  33. orionis/test/exceptions/persistence.py +4 -8
  34. orionis/test/exceptions/runtime.py +4 -8
  35. orionis/test/exceptions/value.py +5 -13
  36. orionis/test/kernel.py +14 -42
  37. orionis/test/output/dumper.py +21 -43
  38. orionis/test/output/printer.py +6 -146
  39. orionis/test/records/logs.py +57 -121
  40. orionis/test/validators/base_path.py +8 -6
  41. orionis/test/validators/execution_mode.py +2 -3
  42. orionis/test/validators/fail_fast.py +4 -8
  43. orionis/test/validators/folder_path.py +5 -7
  44. orionis/test/validators/module_name.py +3 -3
  45. orionis/test/validators/name_pattern.py +4 -9
  46. orionis/test/validators/pattern.py +4 -9
  47. orionis/test/validators/persistent.py +4 -14
  48. orionis/test/validators/persistent_driver.py +7 -12
  49. orionis/test/validators/print_result.py +4 -9
  50. orionis/test/validators/tags.py +6 -7
  51. orionis/test/validators/throw_exception.py +7 -14
  52. orionis/test/validators/verbosity.py +15 -5
  53. orionis/test/validators/web_report.py +6 -10
  54. orionis/test/validators/workers.py +9 -4
  55. orionis/test/view/render.py +9 -26
  56. {orionis-0.432.0.dist-info → orionis-0.434.0.dist-info}/METADATA +1 -1
  57. {orionis-0.432.0.dist-info → orionis-0.434.0.dist-info}/RECORD +76 -75
  58. tests/support/entities/mock_dataclass.py +16 -10
  59. tests/support/entities/test_base.py +6 -14
  60. tests/support/patterns/singleton/test_patterns_singleton.py +7 -8
  61. tests/support/standard/test_services_std.py +113 -37
  62. tests/support/wrapper/test_services_wrapper_docdict.py +25 -40
  63. tests/testing/cases/test_testing_asynchronous.py +14 -14
  64. tests/testing/cases/test_testing_synchronous.py +12 -14
  65. tests/testing/entities/test_testing_result.py +12 -51
  66. tests/testing/enums/test_testing_status.py +8 -13
  67. tests/testing/output/test_testing_dumper.py +3 -6
  68. tests/testing/output/test_testing_printer.py +5 -5
  69. tests/testing/records/test_testing_records.py +16 -26
  70. tests/testing/test_testing_unit.py +8 -94
  71. tests/testing/validators/test_testing_validators.py +55 -112
  72. tests/testing/view/test_render.py +4 -5
  73. {orionis-0.432.0.dist-info → orionis-0.434.0.dist-info}/WHEEL +0 -0
  74. {orionis-0.432.0.dist-info → orionis-0.434.0.dist-info}/licenses/LICENCE +0 -0
  75. {orionis-0.432.0.dist-info → orionis-0.434.0.dist-info}/top_level.txt +0 -0
  76. {orionis-0.432.0.dist-info → orionis-0.434.0.dist-info}/zip-safe +0 -0
@@ -5,29 +5,57 @@ from orionis.test.enums import TestStatus
5
5
  @dataclass(frozen=True, kw_only=True)
6
6
  class TestResult:
7
7
  """
8
- Data class representing the outcome of a test execution.
8
+ Represents the outcome of a test execution.
9
9
 
10
- This class encapsulates all relevant information about a test's execution,
11
- including its unique identifier, name, execution status, timing, and any
12
- error details if the test did not pass. It also stores optional metadata
13
- such as the class, method, module, file path, and docstring associated
14
- with the test, if applicable.
10
+ Parameters
11
+ ----------
12
+ id : Any
13
+ Unique identifier for the test result.
14
+ name : str
15
+ Name of the test.
16
+ status : TestStatus
17
+ Status of the test execution (e.g., passed, failed).
18
+ execution_time : float
19
+ Time taken to execute the test, in seconds.
20
+ error_message : Optional[str], optional
21
+ Error message if the test failed, otherwise None.
22
+ traceback : Optional[str], optional
23
+ Traceback information if an error occurred, otherwise None.
24
+ class_name : Optional[str], optional
25
+ Name of the class containing the test, if applicable.
26
+ method : Optional[str], optional
27
+ Name of the method representing the test, if applicable.
28
+ module : Optional[str], optional
29
+ Name of the module containing the test, if applicable.
30
+ file_path : Optional[str], optional
31
+ Path to the file containing the test, if applicable.
32
+ doc_string : Optional[str], optional
33
+ Docstring of the test, if applicable.
15
34
 
16
- Attributes:
17
- id (Any): Unique identifier for the test result.
18
- name (str): Name of the test.
19
- status (TestStatus): Status of the test execution (e.g., passed, failed).
20
- execution_time (float): Time taken to execute the test, in seconds.
21
- error_message (Optional[str]): Error message if the test failed, otherwise None.
22
- traceback (Optional[str]): Traceback information if an error occurred, otherwise None.
23
- class_name (Optional[str]): Name of the class containing the test, if applicable.
24
- method (Optional[str]): Name of the method representing the test, if applicable.
25
- module (Optional[str]): Name of the module containing the test, if applicable.
26
- file_path (Optional[str]): Path to the file containing the test, if applicable.
27
- doc_string (Optional[str]): Docstring of the test, if applicable.
28
-
29
- Returns:
30
- TestResult: An immutable instance containing all details about a single test execution.
35
+ Attributes
36
+ ----------
37
+ id : Any
38
+ Unique identifier for the test result.
39
+ name : str
40
+ Name of the test.
41
+ status : TestStatus
42
+ Status of the test execution.
43
+ execution_time : float
44
+ Time taken to execute the test.
45
+ error_message : Optional[str]
46
+ Error message if the test failed.
47
+ traceback : Optional[str]
48
+ Traceback information if an error occurred.
49
+ class_name : Optional[str]
50
+ Name of the class containing the test.
51
+ method : Optional[str]
52
+ Name of the method representing the test.
53
+ module : Optional[str]
54
+ Name of the module containing the test.
55
+ file_path : Optional[str]
56
+ Path to the file containing the test.
57
+ doc_string : Optional[str]
58
+ Docstring of the test.
31
59
  """
32
60
 
33
61
  # Unique identifier for the test result
@@ -2,26 +2,20 @@ from enum import Enum, auto
2
2
 
3
3
  class TestStatus(Enum):
4
4
  """
5
- TestStatus(Enum)
6
- An enumeration representing the possible statuses that a test can have during its execution.
5
+ Enumeration of possible statuses for a test during execution.
7
6
 
8
- Attributes
9
- ----------
10
- PASSED : auto()
11
- The test completed successfully without any errors or failures.
12
- FAILED : auto()
13
- The test ran to completion but did not produce the expected results.
14
- ERRORED : auto()
15
- An unexpected error occurred during the execution of the test, preventing it from completing.
16
- SKIPPED : auto()
17
- The test was intentionally not executed, typically due to configuration or conditional logic.
18
-
19
- Returns
7
+ Members
20
8
  -------
21
- TestStatus
22
- An instance of the TestStatus enumeration indicating the current status of a test.
9
+ PASSED : enum
10
+ Indicates the test completed successfully without errors or failures.
11
+ FAILED : enum
12
+ Indicates the test completed but did not produce the expected results.
13
+ ERRORED : enum
14
+ Indicates an unexpected error occurred during test execution.
15
+ SKIPPED : enum
16
+ Indicates the test was intentionally not executed.
23
17
  """
24
18
  PASSED = auto() # Test executed successfully
25
19
  FAILED = auto() # Test executed but failed
26
20
  ERRORED = auto() # Error occurred during test execution
27
- SKIPPED = auto() # Test was intentionally skipped
21
+ SKIPPED = auto() # Test was intentionally skipped
@@ -2,26 +2,22 @@ class OrionisTestConfigException(Exception):
2
2
 
3
3
  def __init__(self, msg: str):
4
4
  """
5
- Initializes the OrionisTestConfigException with a descriptive error message.
5
+ Initialize the OrionisTestConfigException.
6
6
 
7
7
  Parameters
8
8
  ----------
9
9
  msg : str
10
- Descriptive error message explaining the cause of the exception.
10
+ The error message describing the cause of the exception.
11
11
  """
12
-
13
- # Call the base Exception class constructor with the message
14
12
  super().__init__(msg)
15
13
 
16
14
  def __str__(self) -> str:
17
15
  """
18
- Returns a formatted string representation of the exception message.
16
+ Return the exception message as a string.
19
17
 
20
18
  Returns
21
19
  -------
22
20
  str
23
- The error message provided during exception initialization.
21
+ The error message provided during initialization.
24
22
  """
25
-
26
- # Return the first argument as the exception message
27
23
  return str(self.args[0])
@@ -4,11 +4,7 @@ class OrionisTestFailureException(Exception):
4
4
 
5
5
  def __init__(self, result: unittest.TestResult):
6
6
  """
7
- Initializes the OrionisTestFailureException with details about failed and errored tests.
8
-
9
- This constructor extracts information from the provided unittest.TestResult object,
10
- including the IDs of tests that failed or encountered errors. It then formats a summary
11
- message listing all such tests and passes this message to the base Exception class.
7
+ Initialize the exception with details of failed and errored tests.
12
8
 
13
9
  Parameters
14
10
  ----------
@@ -25,18 +21,7 @@ class OrionisTestFailureException(Exception):
25
21
  List of formatted error messages for each failed or errored test.
26
22
  text : str
27
23
  Formatted string summarizing all test failures and errors.
28
-
29
- Returns
30
- -------
31
- None
32
- This method does not return a value. It initializes the exception instance.
33
-
34
- Raises
35
- ------
36
- OrionisTestFailureException
37
- Raised when there are failed or errored tests, with a summary message.
38
24
  """
39
-
40
25
  # Collect IDs of failed tests
41
26
  failed_tests = [test.id() for test, _ in result.failures]
42
27
 
@@ -61,13 +46,12 @@ class OrionisTestFailureException(Exception):
61
46
 
62
47
  def __str__(self) -> str:
63
48
  """
64
- Returns a formatted string describing the exception.
49
+ Return a formatted string describing the exception.
65
50
 
66
51
  Returns
67
52
  -------
68
53
  str
69
54
  The summary message containing the number and details of failed and errored tests.
70
55
  """
71
-
72
56
  # Return the first argument passed to the exception as a string
73
57
  return str(self.args[0])
@@ -2,26 +2,22 @@ class OrionisTestPersistenceError(Exception):
2
2
 
3
3
  def __init__(self, msg: str):
4
4
  """
5
- Initializes the OrionisTestPersistenceError with a descriptive error message.
5
+ Initialize the OrionisTestPersistenceError with an error message.
6
6
 
7
7
  Parameters
8
8
  ----------
9
9
  msg : str
10
- A descriptive error message that explains the cause of the exception.
10
+ The error message describing the cause of the exception.
11
11
  """
12
-
13
- # Call the base Exception class constructor with the message
14
12
  super().__init__(msg)
15
13
 
16
14
  def __str__(self) -> str:
17
15
  """
18
- Returns a formatted string representation of the exception message.
16
+ Return the string representation of the exception message.
19
17
 
20
18
  Returns
21
19
  -------
22
20
  str
23
- The error message provided when the exception was raised.
21
+ The error message associated with the exception.
24
22
  """
25
-
26
- # Return the first argument passed to the exception as a string
27
23
  return str(self.args[0])
@@ -2,26 +2,22 @@ class OrionisTestRuntimeError(Exception):
2
2
 
3
3
  def __init__(self, msg: str):
4
4
  """
5
- Initializes the OrionisTestRuntimeError with a descriptive error message.
5
+ Initialize the OrionisTestRuntimeError with a specific error message.
6
6
 
7
7
  Parameters
8
8
  ----------
9
9
  msg : str
10
- Descriptive error message explaining the cause of the exception.
10
+ The error message describing the cause of the exception.
11
11
  """
12
-
13
- # Call the base class constructor with the error message
14
12
  super().__init__(msg)
15
13
 
16
14
  def __str__(self) -> str:
17
15
  """
18
- Returns a formatted string representation of the exception.
16
+ Return the string representation of the exception.
19
17
 
20
18
  Returns
21
19
  -------
22
20
  str
23
- The error message provided during exception initialization.
21
+ The error message provided during initialization.
24
22
  """
25
-
26
- # Return the error message stored in the first argument
27
23
  return str(self.args[0])
@@ -2,30 +2,22 @@ class OrionisTestValueError(Exception):
2
2
 
3
3
  def __init__(self, msg: str):
4
4
  """
5
- Initializes the OrionisTestValueError with a descriptive error message.
5
+ Initialize the OrionisTestValueError exception.
6
6
 
7
7
  Parameters
8
8
  ----------
9
9
  msg : str
10
- Descriptive error message explaining the cause of the exception.
10
+ The error message describing the cause of the exception.
11
11
  """
12
-
13
- # Call the base class constructor with the error message
14
12
  super().__init__(msg)
15
13
 
16
14
  def __str__(self) -> str:
17
15
  """
18
- Returns a formatted string representation of the exception.
19
-
20
- This method retrieves the error message provided during initialization
21
- and returns it as a string. It ensures that when the exception is
22
- converted to a string, the descriptive message is displayed.
16
+ Return the string representation of the exception.
23
17
 
24
18
  Returns
25
19
  -------
26
20
  str
27
- The descriptive error message associated with this exception.
21
+ The error message associated with this exception.
28
22
  """
29
-
30
- # Return the error message stored in the first argument
31
- return str(self.args[0])
23
+ return str(self.args[0])
orionis/test/kernel.py CHANGED
@@ -21,29 +21,22 @@ class TestKernel(ITestKernel):
21
21
  Parameters
22
22
  ----------
23
23
  app : IApplication
24
- The application instance implementing the IApplication contract.
24
+ Application instance implementing the IApplication contract.
25
25
 
26
26
  Raises
27
27
  ------
28
28
  OrionisTestConfigException
29
29
  If the provided app is not an instance of IApplication.
30
30
  """
31
-
32
- # Validate that the app is an instance of IApplication
33
31
  if not isinstance(app, IApplication):
34
32
  raise OrionisTestConfigException(
35
33
  f"Failed to initialize TestKernel: expected IApplication, got {type(app).__module__}.{type(app).__name__}."
36
34
  )
37
35
 
38
- # Load testing configuration from the application
39
36
  self.__config = Testing(**app.config('testing'))
40
-
41
- # Create and configure the unit test instance
42
37
  self.__unit_test: IUnitTest = app.make('core.orionis.testing')
43
38
  self.__unit_test._UnitTest__app = app
44
39
  self.__unit_test._UnitTest__storage = app.path('storage_testing')
45
-
46
- # Initialize the console for output
47
40
  self.__console: IConsole = app.make('core.orionis.console')
48
41
 
49
42
  def __listMatchingFolders(
@@ -53,52 +46,47 @@ class TestKernel(ITestKernel):
53
46
  pattern: str
54
47
  ) -> List[str]:
55
48
  """
56
- List folders within a custom path whose files match a given pattern.
49
+ List folders within a given path containing files matching a pattern.
57
50
 
58
51
  Parameters
59
52
  ----------
60
53
  base_path : Path
61
- The base directory path for relative calculation.
54
+ The base directory path for calculating relative paths.
62
55
  custom_path : Path
63
- The custom directory path to search for matching files.
56
+ The directory path to search for matching files.
64
57
  pattern : str
65
- The filename pattern to match (supports '*' and '?').
58
+ The filename pattern to match, supporting '*' and '?' wildcards.
66
59
 
67
60
  Returns
68
61
  -------
69
62
  List[str]
70
63
  List of relative folder paths containing files matching the pattern.
71
64
  """
72
-
73
- # Compile the pattern into a regex for matching file names
74
65
  regex = re.compile('^' + pattern.replace('*', '.*').replace('?', '.') + '$')
75
66
  matched_folders = set()
76
-
77
- # Walk through the directory tree starting at custom_path
78
67
  for root, _, files in walk(str(custom_path)):
79
-
80
- # Check if any file in the current folder matches the pattern
81
68
  if any(regex.fullmatch(file) for file in files):
82
-
83
- # Calculate the relative path from base_path and add to results
84
69
  rel_path = Path(root).relative_to(base_path).as_posix()
85
70
  matched_folders.add(rel_path)
86
-
87
- # Return the list of matching folder paths
88
71
  return list(matched_folders)
89
72
 
90
73
  def handle(self) -> IUnitTest:
91
74
  """
92
- Configure and execute the unit tests based on the current configuration.
75
+ Configure, discover, and execute unit tests based on the current configuration.
93
76
 
94
77
  Returns
95
78
  -------
96
79
  IUnitTest
97
80
  The configured and executed unit test instance.
81
+
82
+ Raises
83
+ ------
84
+ OrionisTestFailureException
85
+ If test execution fails.
86
+ Exception
87
+ If an unexpected error occurs during test execution.
98
88
  """
99
89
  try:
100
-
101
- # Configure the unit test with parameters from the configuration
102
90
  self.__unit_test.configure(
103
91
  verbosity=self.__config.verbosity,
104
92
  execution_mode=self.__config.execution_mode,
@@ -111,32 +99,21 @@ class TestKernel(ITestKernel):
111
99
  web_report=self.__config.web_report
112
100
  )
113
101
 
114
- # Prepare paths and pattern for test discovery
115
102
  base_path = (Path.cwd() / self.__config.base_path).resolve()
116
103
  folder_path = self.__config.folder_path
117
104
  pattern = self.__config.pattern
118
-
119
- # Set to hold discovered folders
120
105
  discovered_folders = set()
121
106
 
122
- # Discover folders containing test files according to the configuration
123
-
124
- # Search all folders under base_path
125
107
  if folder_path == '*':
126
108
  discovered_folders.update(self.__listMatchingFolders(base_path, base_path, pattern))
127
-
128
- # Search each custom folder in the list
129
109
  elif isinstance(folder_path, list):
130
110
  for custom in folder_path:
131
111
  custom_path = (base_path / custom).resolve()
132
112
  discovered_folders.update(self.__listMatchingFolders(base_path, custom_path, pattern))
133
-
134
- # Search a single custom folder
135
113
  else:
136
114
  custom_path = (base_path / folder_path).resolve()
137
115
  discovered_folders.update(self.__listMatchingFolders(base_path, custom_path, pattern))
138
116
 
139
- # Register discovered folders with the unit test for test discovery
140
117
  for folder in discovered_folders:
141
118
  self.__unit_test.discoverTestsInFolder(
142
119
  folder_path=folder,
@@ -146,15 +123,10 @@ class TestKernel(ITestKernel):
146
123
  tags=self.__config.tags or None
147
124
  )
148
125
 
149
- # Run the unit tests and return the result
150
126
  return self.__unit_test.run()
151
127
 
152
128
  except OrionisTestFailureException as e:
153
-
154
- # Handle test failures and exit with an error message
155
129
  self.__console.exitError(f"Test execution failed: {e}")
156
130
 
157
131
  except Exception as e:
158
-
159
- # Handle unexpected errors and exit with a generic error message
160
- self.__console.exitError(f"An unexpected error occurred: {e}")
132
+ self.__console.exitError(f"An unexpected error occurred: {e}")
@@ -6,34 +6,16 @@ from orionis.test.contracts.dumper import ITestDumper
6
6
 
7
7
  class TestDumper(ITestDumper):
8
8
  """
9
- TestDumper provides utility methods for debugging and outputting information during test execution.
10
-
11
- This class implements methods to:
12
- - Determine if an object is a test case instance.
13
- - Output debugging information using the Debug class.
14
- - Manage standard output and error streams during debugging dumps.
15
- - Capture the caller's file and line number for context.
16
-
17
- Attributes
18
- ----------
19
- None
20
-
21
- Methods
22
- -------
23
- __isTestCaseClass(value)
24
- Determines if the given value is an instance of a test case class.
25
- dd(*args)
26
- Dumps debugging information using the Debug class.
27
- dump(*args)
28
- Dumps debugging information using the Debug class.
9
+ Utility class for debugging and outputting information during test execution.
10
+
11
+ Provides methods to determine if an object is a test case instance, output debugging
12
+ information using the Debug class, manage standard output and error streams, and
13
+ capture the caller's file and line number for context.
29
14
  """
30
15
 
31
16
  def __isTestCaseClass(self, value) -> bool:
32
17
  """
33
- Determines whether the provided value is an instance of a recognized test case class.
34
-
35
- This method checks if the given object is an instance of either AsyncTestCase or SyncTestCase,
36
- which are the supported test case base classes in the Orionis testing framework.
18
+ Check if the provided value is an instance of a recognized test case class.
37
19
 
38
20
  Parameters
39
21
  ----------
@@ -43,8 +25,8 @@ class TestDumper(ITestDumper):
43
25
  Returns
44
26
  -------
45
27
  bool
46
- Returns True if `value` is an instance of AsyncTestCase or SyncTestCase.
47
- Returns False if `value` is None, not an instance of these classes, or if any import error occurs.
28
+ True if `value` is an instance of AsyncTestCase, SyncTestCase, unittest.TestCase,
29
+ or unittest.IsolatedAsyncioTestCase. False otherwise or if an import error occurs.
48
30
  """
49
31
 
50
32
  # If the value is None, it cannot be a test case instance.
@@ -76,23 +58,21 @@ class TestDumper(ITestDumper):
76
58
 
77
59
  def dd(self, *args) -> None:
78
60
  """
79
- Outputs debugging information using the Debug class and halts further execution.
61
+ Output debugging information and halt further execution.
80
62
 
81
- This method captures the caller's file and line number to provide context for the debug output.
82
- It temporarily redirects standard output and error streams to ensure the debug information is
83
- displayed correctly. If the first argument is a recognized test case instance, it is skipped
84
- in the output to avoid redundant information. The method raises an exception if any error
85
- occurs during the dumping process.
63
+ Captures the caller's file and line number for context. Temporarily redirects
64
+ standard output and error streams to ensure correct display. If the first argument
65
+ is a recognized test case instance, it is skipped in the output. Raises a custom
66
+ runtime error if dumping fails.
86
67
 
87
68
  Parameters
88
69
  ----------
89
70
  *args : tuple
90
- Variable length argument list containing the objects to be dumped.
71
+ Objects to be dumped.
91
72
 
92
73
  Returns
93
74
  -------
94
75
  None
95
- This method does not return any value. It outputs debug information and may halt execution.
96
76
  """
97
77
 
98
78
  # If no arguments are provided, exit the method early.
@@ -136,23 +116,21 @@ class TestDumper(ITestDumper):
136
116
 
137
117
  def dump(self, *args) -> None:
138
118
  """
139
- Outputs debugging information using the Debug class.
119
+ Output debugging information.
140
120
 
141
- This method captures the caller's file and line number to provide context for the debug output.
142
- It temporarily redirects standard output and error streams to ensure the debug information is
143
- displayed correctly. If the first argument is a recognized test case instance, it is skipped
144
- in the output to avoid redundant information. The method raises an exception if any error
145
- occurs during the dumping process.
121
+ Captures the caller's file and line number for context. Temporarily redirects
122
+ standard output and error streams to ensure correct display. If the first argument
123
+ is a recognized test case instance, it is skipped in the output. Raises a custom
124
+ runtime error if dumping fails.
146
125
 
147
126
  Parameters
148
127
  ----------
149
128
  *args : tuple
150
- Variable length argument list containing the objects to be dumped.
129
+ Objects to be dumped.
151
130
 
152
131
  Returns
153
132
  -------
154
133
  None
155
- This method does not return any value. It outputs debug information.
156
134
  """
157
135
 
158
136
  # If no arguments are provided, exit the method early.
@@ -192,4 +170,4 @@ class TestDumper(ITestDumper):
192
170
 
193
171
  # Restore the original stdout and stderr
194
172
  sys.stdout = original_stdout
195
- sys.stderr = original_stderr
173
+ sys.stderr = original_stderr