orionis 0.610.0__py3-none-any.whl → 0.611.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.
@@ -5,7 +5,7 @@
5
5
  NAME = "orionis"
6
6
 
7
7
  # Current version of the framework
8
- VERSION = "0.610.0"
8
+ VERSION = "0.611.0"
9
9
 
10
10
  # Full name of the author or maintainer of the project
11
11
  AUTHOR = "Raul Mauricio Uñate Castro"
@@ -638,12 +638,13 @@ class UnitTest(IUnitTest):
638
638
  test_case: unittest.TestCase
639
639
  ) -> bool:
640
640
  """
641
- Check if the given test case contains any debugging or dump calls.
641
+ Determine if the given test case contains debugging or dump calls.
642
642
 
643
- This method inspects the source code of the provided test case to determine
644
- whether it contains any lines that invoke debugging or dump functions, as
645
- specified by the internal `__debbug_keywords` list (e.g., 'self.dd', 'self.dump').
646
- It ignores commented lines and only considers actual code statements.
643
+ This method inspects the source code of the test method and common setup/teardown methods
644
+ (such as `setUp`, `tearDown`, `onSetup`, `onTeardown`) for the presence of any keywords
645
+ specified in the internal `__debbug_keywords` list (e.g., 'self.dd', 'self.dump').
646
+ Commented lines are ignored during inspection. If any debug keyword is found, the method
647
+ disables live console output and returns True.
647
648
 
648
649
  Parameters
649
650
  ----------
@@ -653,48 +654,63 @@ class UnitTest(IUnitTest):
653
654
  Returns
654
655
  -------
655
656
  bool
656
- True if any debug or dump keyword is found in the test case source code,
657
- or if the internal debug flag (`__debbug`) is set. False otherwise.
657
+ True if any debug or dump keyword is found in the test case source code;
658
+ False otherwise.
658
659
 
659
660
  Notes
660
661
  -----
661
- - The method uses reflection to retrieve the source code of the test case.
662
- - Lines that are commented out are skipped during inspection.
663
- - If an error occurs during source code retrieval or inspection, the method returns False.
662
+ - Uses `inspect.getsource` to retrieve the source code of relevant methods.
663
+ - Ignores lines that are commented out.
664
+ - If an error occurs during source code retrieval or inspection, returns False.
665
+ - If a debug keyword is found, disables live console output for the test run.
664
666
  """
665
-
666
667
  try:
667
-
668
- # Retrieve the source code of the test case using reflection
668
+ # Gather method names to inspect: main test method and common setup/teardown hooks
669
669
  method_name = getattr(test_case, "_testMethodName", None)
670
+ extra_methods = ["setUp", "tearDown", "onSetup", "onTeardown"]
671
+ method_names_to_check = [method_name] if method_name else []
672
+ method_names_to_check += [m for m in extra_methods if hasattr(test_case, m)]
673
+
674
+ # Inspect each method's source code for debug keywords
675
+ for mname in method_names_to_check:
676
+
677
+ # Skip if method name is None
678
+ if not mname:
679
+ continue
670
680
 
671
- # If a method name is found, proceed to inspect its source code
672
- if method_name:
681
+ try:
673
682
 
674
- # Get the source code of the specific test method
675
- source = inspect.getsource(getattr(test_case, method_name))
683
+ # Retrieve the source code of the method
684
+ source = inspect.getsource(getattr(test_case, mname))
676
685
 
677
- # Check each line of the source code
686
+ except Exception:
687
+
688
+ # Skip if source cannot be retrieved
689
+ continue
690
+
691
+ # Inspect each line of the source code
678
692
  for line in source.splitlines():
679
693
 
680
- # Strip leading and trailing whitespace from the line
694
+ # Strip leading/trailing whitespace for accurate matching
681
695
  stripped = line.strip()
682
696
 
683
- # Skip lines that are commented out
697
+ # Ignore commented lines
684
698
  if stripped.startswith('#') or re.match(r'^\s*#', line):
685
699
  continue
686
700
 
687
- # If any debug keyword is present in the line, return True
701
+ # Check for any debug keyword in the line
688
702
  if any(keyword in line for keyword in self.__debbug_keywords):
689
- self.__live_console = False if self.__live_console is True else self.__live_console
690
- return True
691
703
 
704
+ # Disable live console output if a debug keyword is found
705
+ if self.__live_console is True:
706
+ self.__live_console = False
707
+ return True
692
708
  except Exception:
693
709
 
694
- # If any error occurs during inspection, return False
710
+ # On any error during inspection, return False
695
711
  return False
696
712
 
697
- # No debug keywords found; return False
713
+ # No debug keywords found in any inspected method
698
714
  return False
699
715
 
700
716
  def run(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.610.0
3
+ Version: 0.611.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -217,7 +217,7 @@ orionis/foundation/providers/scheduler_provider.py,sha256=irwkjMiq-HpsbJxAOnhjji
217
217
  orionis/foundation/providers/testing_provider.py,sha256=2akFnabtH_cV_7z_2cCL7u8cPCGvCJAmlhMcnlCrc4c,3742
218
218
  orionis/foundation/providers/workers_provider.py,sha256=P_YtJuPNrdJAQJkAqI11KI0c6GSB9NqIuuCKpRytE0g,3937
219
219
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
- orionis/metadata/framework.py,sha256=Wxis51jOBs0Ly2h4yTGyRz9ppSd_oFXruIJ6t-B0j74,4109
220
+ orionis/metadata/framework.py,sha256=NgXf6p9_t_5US4HUJ6ELmCMrsT1X7nankg-ixdBqB5Y,4109
221
221
  orionis/metadata/package.py,sha256=k7Yriyp5aUcR-iR8SK2ec_lf0_Cyc-C7JczgXa-I67w,16039
222
222
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
223
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -371,7 +371,7 @@ orionis/test/contracts/render.py,sha256=wpDQzUtT0r8KFZ7zPcxWHXQ1EVNKxzA_rZ6ZKUcZ
371
371
  orionis/test/contracts/test_result.py,sha256=SNXJ2UerkweYn7uCT0i0HmMGP0XBrL_9KJs-0ZvIYU4,4002
372
372
  orionis/test/contracts/unit_test.py,sha256=EyidHoOPJItwgkBWGYY1TymbNklyn2EUXnghVvW4htc,4652
373
373
  orionis/test/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
374
- orionis/test/core/unit_test.py,sha256=5KaCu8anWP9Ei-Axd61roCogpoo1Frs81h1Rug3RbBw,70920
374
+ orionis/test/core/unit_test.py,sha256=-kQeKqtztmWrJJxluwv52uW9LIE-rn1dbJt0L3MxfXc,71619
375
375
  orionis/test/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
376
376
  orionis/test/entities/result.py,sha256=eZ6UIqGmFW8FZ9x8PB_MZbLAc-SAuUyi4FUcMYIZzGo,4777
377
377
  orionis/test/enums/__init__.py,sha256=M3imAgMvKFTKg55FbtVoY3zxj7QRY9AfaUWxiSZVvn4,66
@@ -404,8 +404,8 @@ orionis/test/validators/workers.py,sha256=rWcdRexINNEmGaO7mnc1MKUxkHKxrTsVuHgbnI
404
404
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
405
405
  orionis/test/view/render.py,sha256=R55ykeRs0wDKcdTf4O1YZ8GDHTFmJ0IK6VQkbJkYUvo,5571
406
406
  orionis/test/view/report.stub,sha256=QLqqCdRoENr3ECiritRB3DO_MOjRQvgBh5jxZ3Hs1r0,28189
407
- orionis-0.610.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
- orionis-0.610.0.dist-info/METADATA,sha256=XTzhBWyc4DB5ULxSGO9ocB7nY98Zj29vUafUbLjzbT4,4801
409
- orionis-0.610.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
- orionis-0.610.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
- orionis-0.610.0.dist-info/RECORD,,
407
+ orionis-0.611.0.dist-info/licenses/LICENCE,sha256=JhC-z_9mbpUrCfPjcl3DhDA8trNDMzb57cvRSam1avc,1463
408
+ orionis-0.611.0.dist-info/METADATA,sha256=5nWXFpdzTFEbW_uhSwVLetqL6rVN6tNcTliHpn385Oo,4801
409
+ orionis-0.611.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
410
+ orionis-0.611.0.dist-info/top_level.txt,sha256=lyXi6jArpqJ-0zzNqd_uwsH-z9TCEBVBL-pC3Ekv7hU,8
411
+ orionis-0.611.0.dist-info/RECORD,,