piltest 0.1.0__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.
piltest-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: piltest
3
+ Version: 0.1.0
4
+ Summary: A lightweight Python testing framework
5
+ Author-email: Arlo Talkington <mongpod67@gmail.com>
6
+ License-Expression: MIT
7
+ Keywords: testing,test-runner,unittest
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Software Development :: Testing
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
@@ -0,0 +1 @@
1
+ from .main import Test
@@ -0,0 +1,53 @@
1
+ import traceback
2
+
3
+ class Test:
4
+ def _collect(self):
5
+ for name in dir(self):
6
+ if not name.startswith('test_'):
7
+ continue
8
+
9
+ o = getattr(self, name, None)
10
+
11
+ if not callable(o):
12
+ continue
13
+
14
+ yield name.removeprefix('test_'), o
15
+
16
+ def main(self):
17
+ tests = dict(self._collect())
18
+
19
+ statuses = {'success': [], 'failed': [], 'errored': []}
20
+
21
+ for name, func in tests.items():
22
+ try:
23
+ func()
24
+ print('.', end='')
25
+ statuses['success'].append((name, None))
26
+ except AssertionError as e:
27
+ tb = traceback.extract_tb(e.__traceback__)
28
+ frame = tb[-1]
29
+
30
+ print('F', end='')
31
+ statuses['failed'].append((name, f'{str(e) or repr(frame.line)}\n\tat {frame.filename}:{frame.lineno}'))
32
+ except Exception as e:
33
+ tb = traceback.extract_tb(e.__traceback__)
34
+ frame = tb[-1]
35
+
36
+ print('E', end='')
37
+ statuses['errored'].append((name, f'{e.__class__.__name__}: {str(e) or repr(frame.line)}\n\tat {frame.filename}:{frame.lineno}'))
38
+
39
+ print()
40
+ print('Succeeded:')
41
+ for name, _ in statuses['success']:
42
+ print(f'\t-> {name}')
43
+ print('Failed:')
44
+ for name, msg in statuses['failed']:
45
+ print(f'\t-> {name}: {msg}')
46
+ print('Unexpected errors:')
47
+ for name, msg in statuses['errored']:
48
+ print(f'\t-> {name}: {msg}')
49
+
50
+ print(f'{len(statuses["success"])}/{len(tests)} succeeded')
51
+ print(f'{len(statuses['success'])} succeeded, {len(statuses["failed"])} failed, {len(statuses['errored'])} unexpected error(s)')
52
+
53
+ return int(bool(statuses['errored'] or statuses['failed']))
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: piltest
3
+ Version: 0.1.0
4
+ Summary: A lightweight Python testing framework
5
+ Author-email: Arlo Talkington <mongpod67@gmail.com>
6
+ License-Expression: MIT
7
+ Keywords: testing,test-runner,unittest
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Topic :: Software Development :: Testing
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
@@ -0,0 +1,7 @@
1
+ pyproject.toml
2
+ piltest/__init__.py
3
+ piltest/main.py
4
+ piltest.egg-info/PKG-INFO
5
+ piltest.egg-info/SOURCES.txt
6
+ piltest.egg-info/dependency_links.txt
7
+ piltest.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ dist
2
+ piltest
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "piltest"
7
+ version = "0.1.0"
8
+ description = "A lightweight Python testing framework"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "Arlo Talkington", email = "mongpod67@gmail.com" }
14
+ ]
15
+ keywords = ["testing", "test-runner", "unittest"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Software Development :: Testing"
21
+ ]
22
+
23
+ [tool.setuptools.packages.find]
24
+ where = ["."]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+