init
This commit is contained in:
commit
eb9b49c962
20
setup.py
Normal file
20
setup.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="testpkg",
|
||||||
|
version="0.1",
|
||||||
|
packages=find_packages(),
|
||||||
|
install_requires=[],
|
||||||
|
author="Test",
|
||||||
|
author_email="test@dont_spam_me.co",
|
||||||
|
description="A simple example private package",
|
||||||
|
long_description=open("README.md").read(),
|
||||||
|
long_description_content_type="text/markdown",
|
||||||
|
# url="https://github.com/nydasco/package_publishing",
|
||||||
|
classifiers=[
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
],
|
||||||
|
python_requires='>=3.6',
|
||||||
|
)
|
2
testpkg/__init__.py
Normal file
2
testpkg/__init__.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
from .mod1 import test_add, test_sub
|
||||||
|
from .mod2 import test_mul, test_div
|
5
testpkg/mod1.py
Normal file
5
testpkg/mod1.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
def test_add(a, b):
|
||||||
|
return a+b
|
||||||
|
|
||||||
|
def test_sub(a, b):
|
||||||
|
return a-b
|
5
testpkg/mod2.py
Normal file
5
testpkg/mod2.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
def test_mul(a, b):
|
||||||
|
return a*b
|
||||||
|
|
||||||
|
def test_div(a, b):
|
||||||
|
return a/b
|
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
15
tests/test1.py
Normal file
15
tests/test1.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import unittest
|
||||||
|
from testpkg import test_add, test_sub
|
||||||
|
|
||||||
|
class TestModule1(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_add(self):
|
||||||
|
self.assertEqual(test_add(1, 2), 3)
|
||||||
|
self.assertEqual(test_add(-1, 1), 0)
|
||||||
|
|
||||||
|
def test_subtract(self):
|
||||||
|
self.assertEqual(test_sub(2, 1), 1)
|
||||||
|
self.assertEqual(test_sub(2, 3), -1)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
Loading…
x
Reference in New Issue
Block a user