From b6e2a91ea2bf1bb3bc3beb48304f5d60906e78a6 Mon Sep 17 00:00:00 2001 From: androiddrew Date: Tue, 12 Sep 2017 11:15:56 -0400 Subject: [PATCH] Added Testing coverage to the client --- .coveragerc | 3 +++ CHANGES.txt | 0 README.md | 12 +++++++++++- setup.py | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .coveragerc create mode 100644 CHANGES.txt create mode 100644 setup.py diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..9b84fa3 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[run] +source = apitesting +omit = test* \ No newline at end of file diff --git a/CHANGES.txt b/CHANGES.txt new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 5fefeb9..561a1ad 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # apitesting -A sample project illustrating how to write tests against an external API \ No newline at end of file +A sample project illustrating how to write tests against an external API + +## Testing + +To run the test suite with coverage first install the package in editable mode with it's testing requirements: + +`pip install -e ".[testing]"` + +To run the project's tests + +`pytest --cov` \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..af1b3fe --- /dev/null +++ b/setup.py @@ -0,0 +1,39 @@ +import os + +from setuptools import setup, find_packages + +here = os.path.abspath(os.path.dirname(__file__)) +with open(os.path.join(here, 'README.md')) as f: + README = f.read() +with open(os.path.join(here, 'CHANGES.txt')) as f: + CHANGES = f.read() + +requires = [ + 'requests' +] + +tests_require = [ + 'pytest', + 'pytest-cov', +] + +setup( + name='apitesting', + version='0.0', + description='A toy API client with tests', + long_description=README + '\n\n' + CHANGES, + classifiers=[ + 'Programming Language :: Python' + ], + author='Androiddrew', + author_email='drew@androiddrew.com', + url='https://blog.androiddrew.com', + keywords='API client testing', + packages=find_packages(), + include_package_data=True, + zip_safe=False, + extras_require={ + 'testing': tests_require, + }, + install_requires=requires, +) \ No newline at end of file