zipline/conda/parameterized/meta.yaml
2017-11-08 01:13:07 -05:00

97 lines
12 KiB
YAML

{% set name = "parameterized" %}
{% set version = "0.6.1" %}
{% set file_ext = "tar.gz" %}
{% set hash_type = "sha256" %}
{% set hash_value = "caf58e717097735de0d7e15386a46ffa5ce25bb6a13a43716a8854a8d34841e2" %}
package:
name: '{{ name|lower }}'
version: '{{ version }}'
source:
fn: '{{ name }}-{{ version }}.{{ file_ext }}'
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}
'{{ hash_type }}': '{{ hash_value }}'
build:
number: 0
script: python setup.py install --single-version-externally-managed --record=record.txt
requirements:
build:
- python
- setuptools
run:
- python
test:
imports:
- parameterized
about:
home: https://github.com/wolever/parameterized
license: BSD License
license_family: BSD
license_file: ''
summary: Parameterized testing with any Python test framework
description: "Parameterized testing with any Python test framework\n====================================================\n\n.. image:: https://travis-ci.org/wolever/parameterized.svg?branch=master\n \
\ :target: https://travis-ci.org/wolever/parameterized\n\nParameterized testing in Python sucks.\n\n``parameterized`` fixes that. For everything. Parameterized testing for nose,\nparameterized testing\
\ for py.test, parameterized testing for unittest.\n\n.. code:: python\n\n # test_math.py\n from nose.tools import assert_equal\n from parameterized import parameterized\n\n import unittest\n\
\ import math\n\n @parameterized([\n (2, 2, 4),\n (2, 3, 8),\n (1, 9, 1),\n (0, 9, 0),\n ])\n def test_pow(base, exponent, expected):\n assert_equal(math.pow(base,\
\ exponent), expected)\n\n class TestMathUnitTest(unittest.TestCase):\n @parameterized.expand([\n (\"negative\", -1.5, -2.0),\n (\"integer\", 1, 1.0),\n (\"\
large fraction\", 1.6, 1),\n ])\n def test_floor(self, name, input, expected):\n assert_equal(math.floor(input), expected)\n\nWith nose (and nose2)::\n\n $ nosetests -v test_math.py\n\
\ test_math.test_pow(2, 2, 4) ... ok\n test_math.test_pow(2, 3, 8) ... ok\n test_math.test_pow(1, 9, 1) ... ok\n test_math.test_pow(0, 9, 0) ... ok\n test_floor_0_negative (test_math.TestMathUnitTest)\
\ ... ok\n test_floor_1_integer (test_math.TestMathUnitTest) ... ok\n test_floor_2_large_fraction (test_math.TestMathUnitTest) ... ok\n\n ----------------------------------------------------------------------\n\
\ Ran 7 tests in 0.002s\n\n OK\n\nAs the package name suggests, nose is best supported and will be used for all\nfurther examples.\n\nWith py.test (version 2.0 and above)::\n\n $ py.test -v\
\ test_math.py\n ============================== test session starts ==============================\n platform darwin -- Python 2.7.2 -- py-1.4.30 -- pytest-2.7.1\n collected 7 items\n\n \
\ test_math.py::test_pow::[0] PASSED\n test_math.py::test_pow::[1] PASSED\n test_math.py::test_pow::[2] PASSED\n test_math.py::test_pow::[3] PASSED\n test_math.py::TestMathUnitTest::test_floor_0_negative\n\
\ test_math.py::TestMathUnitTest::test_floor_1_integer\n test_math.py::TestMathUnitTest::test_floor_2_large_fraction\n\n =========================== 7 passed in 0.10 seconds ============================\n\
\nWith unittest (and unittest2)::\n\n $ python -m unittest -v test_math\n test_floor_0_negative (test_math.TestMathUnitTest) ... ok\n test_floor_1_integer (test_math.TestMathUnitTest) ... ok\n\
\ test_floor_2_large_fraction (test_math.TestMathUnitTest) ... ok\n\n ----------------------------------------------------------------------\n Ran 3 tests in 0.000s\n\n OK\n\n(note: because\
\ unittest does not support test decorators, only tests created\nwith ``@parameterized.expand`` will be executed)\n\nInstallation\n------------\n\n::\n\n $ pip install parameterized\n\n\nCompatibility\n\
-------------\n\n`Yes`__.\n\n__ https://travis-ci.org/wolever/parameterized\n\n.. list-table::\n :header-rows: 1\n :stub-columns: 1\n\n * -\n - Py2.6\n - Py2.7\n - Py3.3\n - Py3.4\n\
\ - PyPy\n * - nose\n - yes\n - yes\n - yes\n - yes\n - yes\n * - nose2\n - yes\n - yes\n - yes\n - yes\n - yes\n * - py.test\n - yes\n - yes\n\
\ - yes\n - yes\n - yes\n * - | unittest\n | (``@parameterized.expand``)\n - yes\n - yes\n - yes\n - yes\n - yes\n * - | unittest2\n | (``@parameterized.expand``)\n\
\ - yes\n - yes\n - yes\n - yes\n - yes\n\nDependencies\n------------\n\n(this section left intentionally blank)\n\n\nExhaustive Usage Examples\n--------------------------\n\nThe\
\ ``@parameterized`` and ``@parameterized.expand`` decorators accept a list\nor iterable of tuples or ``param(...)``, or a callable which returns a list or\niterable:\n\n.. code:: python\n\n from\
\ parameterized import parameterized, param\n\n # A list of tuples\n @parameterized([\n (2, 3, 5),\n (3, 5, 8),\n ])\n def test_add(a, b, expected):\n assert_equal(a\
\ + b, expected)\n\n # A list of params\n @parameterized([\n param(\"10\", 10),\n param(\"10\", 16, base=16),\n ])\n def test_int(str_val, expected, base=10):\n assert_equal(int(str_val,\
\ base=base), expected)\n\n # An iterable of params\n @parameterized(\n param.explicit(*json.loads(line))\n for line in open(\"testcases.jsons\")\n )\n def test_from_json_file(...):\n\
\ ...\n\n # A callable which returns a list of tuples\n def load_test_cases():\n return [\n (\"test1\", ),\n (\"test2\", ),\n ]\n @parameterized(load_test_cases)\n\
\ def test_from_function(name):\n ...\n\n.. **\n\nNote that, when using an iterator or a generator, all the items will be loaded\ninto memory before the start of the test run (we do this explicitly\
\ to ensure\nthat generators are exhausted exactly once in multi-process or multi-threaded\ntesting environments).\n\nThe ``@parameterized`` decorator can be used test class methods, and standalone\n\
functions:\n\n.. code:: python\n\n from parameterized import parameterized\n\n class AddTest(object):\n @parameterized([\n (2, 3, 5),\n ])\n def test_add(self,\
\ a, b, expected):\n assert_equal(a + b, expected)\n\n @parameterized([\n (2, 3, 5),\n ])\n def test_add(a, b, expected):\n assert_equal(a + b, expected)\n\n\nAnd ``@parameterized.expand``\
\ can be used to generate test methods in\nsituations where test generators cannot be used (for example, when the test\nclass is a subclass of ``unittest.TestCase``):\n\n.. code:: python\n\n import\
\ unittest\n from parameterized import parameterized\n\n class AddTestCase(unittest.TestCase):\n @parameterized.expand([\n (\"2 and 3\", 2, 3, 5),\n (\"3 and 5\",\
\ 2, 3, 5),\n ])\n def test_add(self, _, a, b, expected):\n assert_equal(a + b, expected)\n\nWill create the test cases::\n\n $ nosetests example.py\n test_add_0_2_and_3\
\ (example.AddTestCase) ... ok\n test_add_1_3_and_5 (example.AddTestCase) ... ok\n\n ----------------------------------------------------------------------\n Ran 2 tests in 0.001s\n\n OK\n\
\nNote that ``@parameterized.expand`` works by creating new methods on the test\nclass. If the first parameter is a string, that string will be added to the end\nof the method name. For example, the\
\ test case above will generate the methods\n``test_add_0_2_and_3`` and ``test_add_1_3_and_5``.\n\nThe names of the test cases generated by ``@parameterized.expand`` can be\ncustomized using the ``testcase_func_name``\
\ keyword argument. The value should\nbe a function which accepts three arguments: ``testcase_func``, ``param_num``,\nand ``params``, and it should return the name of the test case.\n``testcase_func``\
\ will be the function to be tested, ``param_num`` will be the\nindex of the test case parameters in the list of parameters, and ``param``\n(an instance of ``param``) will be the parameters which will\
\ be used.\n\n.. code:: python\n\n import unittest\n from parameterized import parameterized\n\n def custom_name_func(testcase_func, param_num, param):\n return \"%s_%s\" %(\n \
\ testcase_func.__name__,\n parameterized.to_safe_name(\"_\".join(str(x) for x in param.args)),\n )\n\n class AddTestCase(unittest.TestCase):\n @parameterized.expand([\n\
\ (2, 3, 5),\n (2, 3, 5),\n ], testcase_func_name=custom_name_func)\n def test_add(self, a, b, expected):\n assert_equal(a + b, expected)\n\nWill create\
\ the test cases::\n\n $ nosetests example.py\n test_add_1_2_3 (example.AddTestCase) ... ok\n test_add_2_3_5 (example.AddTestCase) ... ok\n\n ----------------------------------------------------------------------\n\
\ Ran 2 tests in 0.001s\n\n OK\n\n\nThe ``param(...)`` helper class stores the parameters for one specific test\ncase. It can be used to pass keyword arguments to test cases:\n\n.. code:: python\n\
\n from parameterized import parameterized, param\n\n @parameterized([\n param(\"10\", 10),\n param(\"10\", 16, base=16),\n ])\n def test_int(str_val, expected, base=10):\n\
\ assert_equal(int(str_val, base=base), expected)\n\n\nIf test cases have a docstring, the parameters for that test case will be\nappended to the first line of the docstring. This behavior can\
\ be controlled\nwith the ``doc_func`` argument:\n\n.. code:: python\n\n from parameterized import parameterized\n\n @parameterized([\n (1, 2, 3),\n (4, 5, 9),\n ])\n def test_add(a,\
\ b, expected):\n \"\"\" Test addition. \"\"\"\n assert_equal(a + b, expected)\n\n def my_doc_func(func, num, param):\n return \"%s: %s with %s\" %(num, func.__name__, param)\n\
\n @parameterized([\n (5, 4, 1),\n (9, 6, 3),\n ], doc_func=my_doc_func)\n def test_subtraction(a, b, expected):\n assert_equal(a - b, expected)\n\n::\n\n $ nosetests\
\ example.py\n Test addition. [with a=1, b=2, expected=3] ... ok\n Test addition. [with a=4, b=5, expected=9] ... ok\n 0: test_subtraction with param(*(5, 4, 1)) ... ok\n 1: test_subtraction\
\ with param(*(9, 6, 3)) ... ok\n\n ----------------------------------------------------------------------\n Ran 4 tests in 0.001s\n\n OK\n\n\nMigrating from ``nose-parameterized`` to ``parameterized``\n\
----------------------------------------------------------\n\nTo migrate a codebase from ``nose-parameterized`` to ``parameterized``:\n\n1. Update your requirements file, replacing ``nose-parameterized``\
\ with\n ``parameterized``.\n\n2. Replace all references to ``nose_parameterized`` with ``parameterized``::\n\n $ perl -pi -e 's/nose_parameterized/parameterized/g' your-codebase/\n\n3. You're\
\ done!\n\n\nFAQ\n---\n\nWhat happened to ``nose-parameterized``?\n Originally only nose was supported. But now everything is supported, and it\n only made sense to change the name!\n\nWhat do\
\ you mean when you say \"nose is best supported\"?\n There are small caveates with ``py.test`` and ``unittest``: ``py.test``\n does not show the parameter values (ex, it will show ``test_add[0]``\n\
\ instead of ``test_add[1, 2, 3]``), and ``unittest``/``unittest2`` do not\n support test generators so ``@parameterized.expand`` must be used.\n\nWhy not use ``@pytest.mark.parametrize``?\n \
\ Because spelling is difficult. Also, ``parameterized`` doesn't require you\n to repeat argument names, and (using ``param``) it supports optional\n keyword arguments.\n\nWhy do I get an ``AttributeError:\
\ 'function' object has no attribute 'expand'`` with ``@parameterized.expand``?\n You've likely installed the ``parametrized`` (note the missing *e*)\n package. Use ``parameterized`` (with the\
\ *e*) instead and you'll be all\n set.\n"
doc_url: ''
dev_url: ''
extra:
recipe-maintainers: ''