stouputils 1.2.12__tar.gz → 1.2.13__tar.gz

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 (24) hide show
  1. {stouputils-1.2.12 → stouputils-1.2.13}/PKG-INFO +1 -1
  2. {stouputils-1.2.12 → stouputils-1.2.13}/pyproject.toml +1 -1
  3. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/all_doctests.py +11 -2
  4. {stouputils-1.2.12 → stouputils-1.2.13}/.gitignore +0 -0
  5. {stouputils-1.2.12 → stouputils-1.2.13}/LICENSE +0 -0
  6. {stouputils-1.2.12 → stouputils-1.2.13}/README.md +0 -0
  7. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/__init__.py +0 -0
  8. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/applications/__init__.py +0 -0
  9. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/applications/automatic_docs.py +0 -0
  10. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/archive.py +0 -0
  11. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/backup.py +0 -0
  12. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/collections.py +0 -0
  13. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/continuous_delivery/__init__.py +0 -0
  14. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/continuous_delivery/cd_utils.py +0 -0
  15. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/continuous_delivery/github.py +0 -0
  16. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/continuous_delivery/pypi.py +0 -0
  17. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/continuous_delivery/pyproject.py +0 -0
  18. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/ctx.py +0 -0
  19. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/decorators.py +0 -0
  20. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/dont_look/zip_file_override.py +0 -0
  21. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/io.py +0 -0
  22. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/parallel.py +0 -0
  23. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/print.py +0 -0
  24. {stouputils-1.2.12 → stouputils-1.2.13}/stouputils/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stouputils
3
- Version: 1.2.12
3
+ Version: 1.2.13
4
4
  Summary: Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more.
5
5
  Project-URL: Homepage, https://github.com/Stoupy51/stouputils
6
6
  Project-URL: Issues, https://github.com/Stoupy51/stouputils/issues
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
 
6
6
  [project]
7
7
  name = "stouputils"
8
- version = "1.2.12"
8
+ version = "1.2.13"
9
9
  description = "Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more."
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.10"
@@ -23,7 +23,7 @@ def test_module_with_progress(module: ModuleType, separator: str) -> TestResults
23
23
  return internal()
24
24
 
25
25
  # Main program
26
- def launch_tests(root_dir: str, importing_errors: LogLevels = LogLevels.WARNING_TRACEBACK, strict: bool = True) -> None:
26
+ def launch_tests(root_dir: str, importing_errors: LogLevels = LogLevels.WARNING_TRACEBACK, strict: bool = True) -> int:
27
27
  """ Main function to launch tests for all modules in the given directory.
28
28
 
29
29
  Args:
@@ -31,6 +31,9 @@ def launch_tests(root_dir: str, importing_errors: LogLevels = LogLevels.WARNING_
31
31
  importing_errors (LogLevels): Log level for the errors when importing modules
32
32
  strict (bool): Modify the force_raise_exception variable to True in the decorators module
33
33
 
34
+ Returns:
35
+ int: The number of failed tests
36
+
34
37
  Examples:
35
38
  >>> launch_tests("unknown_dir")
36
39
  Traceback (most recent call last):
@@ -39,7 +42,8 @@ def launch_tests(root_dir: str, importing_errors: LogLevels = LogLevels.WARNING_
39
42
 
40
43
  .. code-block:: python
41
44
 
42
- > launch_tests("/path/to/source")
45
+ > if launch_tests("/path/to/source") > 0:
46
+ sys.exit(1)
43
47
  [PROGRESS HH:MM:SS] Importing module 'module1' took 0.001s
44
48
  [PROGRESS HH:MM:SS] Importing module 'module2' took 0.002s
45
49
  [PROGRESS HH:MM:SS] Importing module 'module3' took 0.003s
@@ -89,10 +93,15 @@ def launch_tests(root_dir: str, importing_errors: LogLevels = LogLevels.WARNING_
89
93
  results: list[TestResults] = [test_module_with_progress(module, separator) for module, separator in zip(modules, separators)]
90
94
 
91
95
  # Display any error lines for each module at the end of the script
96
+ nb_failed_tests: int = 0
92
97
  for module, result in zip(modules, results):
93
98
  if result.failed > 0:
94
99
  error(f"Errors in module {module.__name__}", exit=False)
100
+ nb_failed_tests += result.failed
95
101
 
96
102
  # Reset force_raise_exception back
97
103
  decorators.force_raise_exception = strict
98
104
 
105
+ # Return the number of failed tests
106
+ return nb_failed_tests
107
+
File without changes
File without changes
File without changes