punit 0.1.3__tar.gz → 0.1.5__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 (30) hide show
  1. {punit-0.1.3 → punit-0.1.5}/PKG-INFO +1 -1
  2. {punit-0.1.3 → punit-0.1.5}/punit/__init__.py +1 -1
  3. {punit-0.1.3 → punit-0.1.5}/punit/facts/Fact.py +4 -0
  4. {punit-0.1.3 → punit-0.1.5}/punit/facts/FactManager.py +1 -4
  5. {punit-0.1.3 → punit-0.1.5}/punit/reports/HtmlReportGenerator.py +1 -1
  6. {punit-0.1.3 → punit-0.1.5}/punit/theories/Theory.py +4 -0
  7. {punit-0.1.3 → punit-0.1.5}/punit/theories/TheoryManager.py +1 -4
  8. {punit-0.1.3 → punit-0.1.5}/punit.egg-info/PKG-INFO +1 -1
  9. {punit-0.1.3 → punit-0.1.5}/pyproject.toml +1 -1
  10. {punit-0.1.3 → punit-0.1.5}/LICENSE +0 -0
  11. {punit-0.1.3 → punit-0.1.5}/README.md +0 -0
  12. {punit-0.1.3 → punit-0.1.5}/punit/TestResult.py +0 -0
  13. {punit-0.1.3 → punit-0.1.5}/punit/__main__.py +0 -0
  14. {punit-0.1.3 → punit-0.1.5}/punit/assertions/__init__.py +0 -0
  15. {punit-0.1.3 → punit-0.1.5}/punit/assertions/collections.py +0 -0
  16. {punit-0.1.3 → punit-0.1.5}/punit/assertions/exceptions.py +0 -0
  17. {punit-0.1.3 → punit-0.1.5}/punit/assertions/strings.py +0 -0
  18. {punit-0.1.3 → punit-0.1.5}/punit/cli.py +0 -0
  19. {punit-0.1.3 → punit-0.1.5}/punit/discovery/TestModuleDiscovery.py +0 -0
  20. {punit-0.1.3 → punit-0.1.5}/punit/discovery/__init__.py +0 -0
  21. {punit-0.1.3 → punit-0.1.5}/punit/facts/__init__.py +0 -0
  22. {punit-0.1.3 → punit-0.1.5}/punit/reports/JUnitReportGenerator.py +0 -0
  23. {punit-0.1.3 → punit-0.1.5}/punit/reports/__init__.py +0 -0
  24. {punit-0.1.3 → punit-0.1.5}/punit/runner.py +0 -0
  25. {punit-0.1.3 → punit-0.1.5}/punit/theories/__init__.py +0 -0
  26. {punit-0.1.3 → punit-0.1.5}/punit.egg-info/SOURCES.txt +0 -0
  27. {punit-0.1.3 → punit-0.1.5}/punit.egg-info/dependency_links.txt +0 -0
  28. {punit-0.1.3 → punit-0.1.5}/punit.egg-info/entry_points.txt +0 -0
  29. {punit-0.1.3 → punit-0.1.5}/punit.egg-info/top_level.txt +0 -0
  30. {punit-0.1.3 → punit-0.1.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: punit
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: A modernized unit-test framework for Python.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  Project-URL: Documentation, https://punit.readthedocs.io/
@@ -1,7 +1,7 @@
1
1
  # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
- __version__ = '0.1.3'
4
+ __version__ = '0.1.5'
5
5
 
6
6
  from .assertions import *
7
7
  from .facts import *
@@ -34,6 +34,10 @@ class Fact:
34
34
  @property
35
35
  def testName(self) -> str:
36
36
  return self.__testName
37
+
38
+ @property
39
+ def filterName(self) -> str:
40
+ return f'{self.moduleName}/{"" if self.className is None or len(self.className) == 0 else f"{self.className}/"}{self.testName}'
37
41
 
38
42
  async def execute(self, module:ModuleType) -> None:
39
43
  coro:Coroutine = None
@@ -42,9 +42,6 @@ class FactManager:
42
42
  return l
43
43
 
44
44
  def put(self, fact:Fact) -> None:
45
- filterName:str = fact.target.__name__
46
- if hasattr(fact.target, '__qualname__'):
47
- filterName = fact.target.__qualname__
48
- if len(self.__filterPattern.findall(filterName)) > 0:
45
+ if len(self.__filterPattern.findall(fact.filterName)) > 0:
49
46
  l = self.get(fact.moduleName)
50
47
  l.append(fact)
@@ -53,7 +53,7 @@ class HtmlReportGenerator:
53
53
  lines.append(f'<div>Total Failed: <span class="fail">{failureCount}</span></div>')
54
54
  lines.append('<div>&nbsp;</div>')
55
55
  percentstyle = 'pass' if failureCount == 0 else 'fail'
56
- lines.append(f'<div class="passfail-percent">Pass/Fail&nbsp;<span class="percent-{percentstyle}">{100-((failureCount/totalCount)*100):.1f}%</span></div>')
56
+ lines.append(f'<div class="passfail-percent">Pass/Fail&nbsp;<span class="percent-{percentstyle}">{100-(((failureCount/totalCount) if totalCount > 0 else 1)*100):.1f}%</span></div>')
57
57
  lines.append('<div>&nbsp;</div>')
58
58
  lines.append('</div>')
59
59
  currentModuleName = None
@@ -41,6 +41,10 @@ class Theory:
41
41
  @property
42
42
  def testName(self) -> str:
43
43
  return self.__testName
44
+
45
+ @property
46
+ def filterName(self) -> str:
47
+ return f'{self.moduleName}/{"" if self.className is None or len(self.className) == 0 else f"{self.className}/"}{self.testName}'
44
48
 
45
49
  async def execute(self, module:ModuleType, data:tuple) -> None:
46
50
  coro:Coroutine = None
@@ -44,10 +44,7 @@ class TheoryManager:
44
44
  return l
45
45
 
46
46
  def put(self, theory:Theory) -> None:
47
- filterName:str = theory.target.__name__
48
- if hasattr(theory.target, '__qualname__'):
49
- filterName = theory.target.__qualname__
50
- if len(self.__filterPattern.findall(filterName)) > 0:
47
+ if len(self.__filterPattern.findall(theory.filterName)) > 0:
51
48
  l = self.get(theory.moduleName)
52
49
  d = self.__datas.get(theory.target)
53
50
  if d is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: punit
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: A modernized unit-test framework for Python.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  Project-URL: Documentation, https://punit.readthedocs.io/
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "punit"
3
- version = "0.1.3"
3
+ version = "0.1.5"
4
4
  description = "A modernized unit-test framework for Python."
5
5
  keywords = ["test", "unittest", "unit-test"]
6
6
  authors = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes