punit 0.1.2__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.2 → punit-0.1.5}/LICENSE +1 -1
  2. {punit-0.1.2 → punit-0.1.5}/PKG-INFO +1 -1
  3. {punit-0.1.2 → punit-0.1.5}/punit/TestResult.py +1 -1
  4. {punit-0.1.2 → punit-0.1.5}/punit/__init__.py +2 -2
  5. {punit-0.1.2 → punit-0.1.5}/punit/__main__.py +1 -1
  6. {punit-0.1.2 → punit-0.1.5}/punit/assertions/__init__.py +1 -1
  7. {punit-0.1.2 → punit-0.1.5}/punit/assertions/collections.py +1 -1
  8. {punit-0.1.2 → punit-0.1.5}/punit/assertions/exceptions.py +1 -1
  9. {punit-0.1.2 → punit-0.1.5}/punit/assertions/strings.py +1 -1
  10. {punit-0.1.2 → punit-0.1.5}/punit/cli.py +1 -1
  11. {punit-0.1.2 → punit-0.1.5}/punit/discovery/TestModuleDiscovery.py +1 -1
  12. {punit-0.1.2 → punit-0.1.5}/punit/discovery/__init__.py +1 -1
  13. {punit-0.1.2 → punit-0.1.5}/punit/facts/Fact.py +5 -1
  14. {punit-0.1.2 → punit-0.1.5}/punit/facts/FactManager.py +2 -5
  15. {punit-0.1.2 → punit-0.1.5}/punit/facts/__init__.py +1 -1
  16. {punit-0.1.2 → punit-0.1.5}/punit/reports/HtmlReportGenerator.py +2 -2
  17. {punit-0.1.2 → punit-0.1.5}/punit/reports/JUnitReportGenerator.py +1 -1
  18. {punit-0.1.2 → punit-0.1.5}/punit/reports/__init__.py +1 -1
  19. {punit-0.1.2 → punit-0.1.5}/punit/runner.py +1 -1
  20. {punit-0.1.2 → punit-0.1.5}/punit/theories/Theory.py +5 -1
  21. {punit-0.1.2 → punit-0.1.5}/punit/theories/TheoryManager.py +2 -5
  22. {punit-0.1.2 → punit-0.1.5}/punit/theories/__init__.py +1 -1
  23. {punit-0.1.2 → punit-0.1.5}/punit.egg-info/PKG-INFO +1 -1
  24. {punit-0.1.2 → punit-0.1.5}/pyproject.toml +1 -1
  25. {punit-0.1.2 → punit-0.1.5}/README.md +0 -0
  26. {punit-0.1.2 → punit-0.1.5}/punit.egg-info/SOURCES.txt +0 -0
  27. {punit-0.1.2 → punit-0.1.5}/punit.egg-info/dependency_links.txt +0 -0
  28. {punit-0.1.2 → punit-0.1.5}/punit.egg-info/entry_points.txt +0 -0
  29. {punit-0.1.2 → punit-0.1.5}/punit.egg-info/top_level.txt +0 -0
  30. {punit-0.1.2 → punit-0.1.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Shaun Wilson
3
+ Copyright (c) Shaun Wilson
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: punit
3
- Version: 0.1.2
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,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import sys
@@ -1,7 +1,7 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
- __version__ = '0.1.2'
4
+ __version__ = '0.1.5'
5
5
 
6
6
  from .assertions import *
7
7
  from .facts import *
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import asyncio
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  from typing import Any, Sequence
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  from typing import Callable, get_args
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  from typing import Any
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import os
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import os
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  __all__ = [
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import inspect
@@ -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
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
  ##
4
4
 
@@ -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)
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  from .Fact import Fact, fact
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import traceback
@@ -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
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import datetime
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  from .HtmlReportGenerator import HtmlReportGenerator
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import importlib
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
  ##
4
4
 
@@ -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
@@ -1,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
  ##
4
4
 
@@ -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,4 +1,4 @@
1
- # SPDX-FileCopyrightText: © 2024 Shaun Wilson
1
+ # SPDX-FileCopyrightText: © Shaun Wilson
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  from .Theory import Theory, theory, inlinedata
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: punit
3
- Version: 0.1.2
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.2"
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