punit 1.2.21__tar.gz → 1.2.24__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 (37) hide show
  1. {punit-1.2.21/src/pUnit.egg-info → punit-1.2.24}/PKG-INFO +1 -1
  2. {punit-1.2.21 → punit-1.2.24}/pyproject.toml +1 -1
  3. {punit-1.2.21 → punit-1.2.24/src/pUnit.egg-info}/PKG-INFO +1 -1
  4. {punit-1.2.21 → punit-1.2.24}/src/punit/__init__.py +2 -2
  5. {punit-1.2.21 → punit-1.2.24}/src/punit/facts/Fact.py +1 -1
  6. {punit-1.2.21 → punit-1.2.24}/src/punit/filters/Filter.py +1 -1
  7. {punit-1.2.21 → punit-1.2.24}/src/punit/filters/FilterManager.py +24 -7
  8. {punit-1.2.21 → punit-1.2.24}/src/punit/theories/Theory.py +1 -1
  9. {punit-1.2.21 → punit-1.2.24}/.scripts/punit +0 -0
  10. {punit-1.2.21 → punit-1.2.24}/LICENSE +0 -0
  11. {punit-1.2.21 → punit-1.2.24}/README.md +0 -0
  12. {punit-1.2.21 → punit-1.2.24}/setup.cfg +0 -0
  13. {punit-1.2.21 → punit-1.2.24}/src/pUnit.egg-info/SOURCES.txt +0 -0
  14. {punit-1.2.21 → punit-1.2.24}/src/pUnit.egg-info/dependency_links.txt +0 -0
  15. {punit-1.2.21 → punit-1.2.24}/src/pUnit.egg-info/requires.txt +0 -0
  16. {punit-1.2.21 → punit-1.2.24}/src/pUnit.egg-info/top_level.txt +0 -0
  17. {punit-1.2.21 → punit-1.2.24}/src/punit/TestResult.py +0 -0
  18. {punit-1.2.21 → punit-1.2.24}/src/punit/__main__.py +0 -0
  19. {punit-1.2.21 → punit-1.2.24}/src/punit/assertions/__init__.py +0 -0
  20. {punit-1.2.21 → punit-1.2.24}/src/punit/assertions/collections.py +0 -0
  21. {punit-1.2.21 → punit-1.2.24}/src/punit/assertions/exceptions.py +0 -0
  22. {punit-1.2.21 → punit-1.2.24}/src/punit/assertions/strings.py +0 -0
  23. {punit-1.2.21 → punit-1.2.24}/src/punit/cli.py +0 -0
  24. {punit-1.2.21 → punit-1.2.24}/src/punit/discovery/TestModuleDiscovery.py +0 -0
  25. {punit-1.2.21 → punit-1.2.24}/src/punit/discovery/__init__.py +0 -0
  26. {punit-1.2.21 → punit-1.2.24}/src/punit/facts/FactManager.py +0 -0
  27. {punit-1.2.21 → punit-1.2.24}/src/punit/facts/__init__.py +0 -0
  28. {punit-1.2.21 → punit-1.2.24}/src/punit/filters/__init__.py +0 -0
  29. {punit-1.2.21 → punit-1.2.24}/src/punit/py.typed +0 -0
  30. {punit-1.2.21 → punit-1.2.24}/src/punit/reports/HtmlReportGenerator.py +0 -0
  31. {punit-1.2.21 → punit-1.2.24}/src/punit/reports/JUnitReportGenerator.py +0 -0
  32. {punit-1.2.21 → punit-1.2.24}/src/punit/reports/__init__.py +0 -0
  33. {punit-1.2.21 → punit-1.2.24}/src/punit/runner.py +0 -0
  34. {punit-1.2.21 → punit-1.2.24}/src/punit/theories/TheoryManager.py +0 -0
  35. {punit-1.2.21 → punit-1.2.24}/src/punit/theories/__init__.py +0 -0
  36. {punit-1.2.21 → punit-1.2.24}/src/punit/traits/Trait.py +0 -0
  37. {punit-1.2.21 → punit-1.2.24}/src/punit/traits/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pUnit
3
- Version: 1.2.21
3
+ Version: 1.2.24
4
4
  Summary: A modernized unit-test framework for Python.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pUnit"
3
- version = "1.2.21"
3
+ version = "1.2.24"
4
4
  description = "A modernized unit-test framework for Python."
5
5
  keywords = ["test", "unittest", "unit-test", "xUnit", "nUnit", "pytest"]
6
6
  authors = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pUnit
3
- Version: 1.2.21
3
+ Version: 1.2.24
4
4
  Summary: A modernized unit-test framework for Python.
5
5
  Author-email: Shaun Wilson <mrshaunwilson@msn.com>
6
6
  License: MIT License
@@ -7,8 +7,8 @@ from .theories import *
7
7
  from .traits import *
8
8
 
9
9
 
10
- __version__ = '1.2.21'
11
- __commit__ = '6811156'
10
+ __version__ = '1.2.24'
11
+ __commit__ = 'aedffaf'
12
12
  __all__ = [
13
13
  '__version__', '__commit__',
14
14
  'assertions',
@@ -41,7 +41,7 @@ class Fact:
41
41
 
42
42
  @property
43
43
  def filterName(self) -> str:
44
- return f'{self.moduleName}/{"" if self.className is None or len(self.className) == 0 else f"{self.className}/"}{self.testName}'
44
+ return f'{".".join(self.moduleName.split(".")[1:])}/{"" if self.className is None or len(self.className) == 0 else f"{self.className}/"}{self.testName}'
45
45
 
46
46
  @property
47
47
  def traits(self) -> list[Trait]:
@@ -22,7 +22,7 @@ class Filter:
22
22
  .replace('\\\\', '/')\
23
23
  .replace('\\*', r'.*')\
24
24
  .replace('?', '.')
25
- return re.compile(pattern)
25
+ return re.compile(pattern, re.IGNORECASE)
26
26
 
27
27
  @property
28
28
  def isExclude(self) -> bool:
@@ -2,6 +2,8 @@
2
2
  # SPDX-License-Identifier: MIT
3
3
 
4
4
  import os
5
+ import select
6
+ import sys
5
7
  from typing import Optional
6
8
 
7
9
  from .Filter import Filter
@@ -38,13 +40,28 @@ class FilterManager:
38
40
 
39
41
  def load(self, filepath:str) -> None:
40
42
  # treat as a filepath containing one or more filter patterns
41
- with open(filepath, 'rb') as f:
42
- for line in f.read().decode().splitlines():
43
- line = line.split('#')[0].strip() # strip comments and prefix/postfix whitespace
44
- if len(line) == 0:
45
- # comments and empty lines
46
- continue
47
- self.__filters.append(Filter(line))
43
+ lines:list[str] = []
44
+ if filepath == 'stdin':
45
+ ready, _, _ = select.select([sys.stdin], [], [], 5)
46
+ if not ready:
47
+ print('No data from stdin, aborting.')
48
+ sys.exit(7)
49
+ lines = sys.stdin.read().splitlines()
50
+ if len(lines) == 0:
51
+ print('No filters from stdin, aborting.')
52
+ sys.exit(6)
53
+ else:
54
+ if not os.path.exists(filepath):
55
+ print(f'file missing or not accessible: {filepath}')
56
+ sys.exit(5)
57
+ with open(filepath, 'rb') as f:
58
+ lines = f.read().decode().splitlines()
59
+ for line in lines:
60
+ line = line.split('#')[0].strip() # strip comments and prefix/postfix whitespace
61
+ if len(line) == 0:
62
+ # comments and empty lines
63
+ continue
64
+ self.__filters.append(Filter(line))
48
65
 
49
66
  def print(self) -> None:
50
67
  if len(FilterManager.instance().filters) > 0:
@@ -52,7 +52,7 @@ class Theory:
52
52
 
53
53
  @property
54
54
  def filterName(self) -> str:
55
- return f'{self.moduleName}/{"" if self.className is None or len(self.className) == 0 else f"{self.className}/"}{self.testName}'
55
+ return f'{".".join(self.moduleName.split(".")[1:])}/{"" if self.className is None or len(self.className) == 0 else f"{self.className}/"}{self.testName}'
56
56
 
57
57
  async def execute(self, module:ModuleType, data:tuple) -> None:
58
58
  coro:Coroutine|None = None
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