From 47aa9f55fd28ccda041050b157dc28129a74bda9 Mon Sep 17 00:00:00 2001 From: Netanel Revah Date: Sun, 28 Jul 2019 17:51:19 +0300 Subject: [PATCH] update readme and setup.py --- README.md | 41 ++++++++++++++++++++++++++++++++++++++++- setup.py | 9 ++++++--- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7ad4b2f..04b191b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ -# parametrization +# pytest-parametrization Simpler PyTest parametrization + +## How to use +### Explicit parameters +```python +from parametrization import Parametrization + +@Parametrization.parameters("actual", "expected") +@Parametrization.case(name="some_case_0", actual=1, expected=2) +@Parametrization.case("some_case_1", actual=1, expected=2) +@Parametrization.case("some_case_2", 1, expected=1) +@Parametrization.case("some_case_3", 2, 2) +@Parametrization.case("some_case_4", 3, 3) +def test_somthing(actual, expected): + assert actual == expected +``` +### Auto-detect parameters +```python +from parametrization import Parametrization + +@Parametrization.autodetect_parameters() +@Parametrization.case(name="some_case_0", actual=1, expected=2) +@Parametrization.case("some_case_1", actual=1, expected=2) +@Parametrization.case("some_case_2", actual=1, expected=1) +def test_somthing(actual, expected): + assert actual == expected +``` +### Auto-detect parameters with default parameter +```python +from parametrization import Parametrization + +@Parametrization.autodetect_parameters() +@Parametrization.default_parameters(expected=None) +@Parametrization.case(name="some_case_0", actual=1, expected=2) +@Parametrization.case("some_case_1", actual=1, expected=2) +@Parametrization.case("some_case_2", actual=1, expected=1) +@Parametrization.case("some_case_2", actual=1) +def test_somthing(actual, expected): + assert actual == expected +``` diff --git a/setup.py b/setup.py index 18b842f..c3ed12c 100644 --- a/setup.py +++ b/setup.py @@ -2,14 +2,17 @@ REQUIREMENTS = ['pytest', 'six'] +README = open('./README.md').read() + setup( name='pytest-parametrization', - version='2019.1.3', + version='2019.1.4', py_modules=['parametrization'], provides=['parametrization'], description='Simpler PyTest parametrization', - author="Singular Labs", - author_email='contact@singular.net', + long_description=README, + author="Singular Labs, Inc", + author_email='devs@singular.net', url='https://github.com/singular-labs/parametrization', keywords="pytest, parametrize, parametrization, singular", install_requires=REQUIREMENTS,