Officially rename to 'parameterized'
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
0.6.0 (unreleased)
|
||||
0.6.0 (2017-03-21)
|
||||
* Rename package from nose-parameterized to parameterized. A
|
||||
nose-parameterized package will be released with a deprecation warning.
|
||||
* Rename testcase_func_doc and testcase_func_name methods to doc_func and
|
||||
name_func (a DeprecationWarning will be issued, to be removed in 1.0).
|
||||
* Include parameters in all docstrings, not just `parameterized.expand`
|
||||
|
||||
58
README.rst
58
README.rst
@@ -1,19 +1,19 @@
|
||||
Parameterized testing with any Python test framework
|
||||
====================================================
|
||||
|
||||
.. image:: https://travis-ci.org/wolever/nose-parameterized.svg?branch=master
|
||||
:target: https://travis-ci.org/wolever/nose-parameterized
|
||||
.. image:: https://travis-ci.org/wolever/parameterized.svg?branch=master
|
||||
:target: https://travis-ci.org/wolever/parameterized
|
||||
|
||||
Parameterized testing in Python sucks.
|
||||
|
||||
``nose-parameterized`` fixes that. For everything. Parameterized testing for
|
||||
nose, parameterized testing for py.test, parameterized testing for unittest.
|
||||
``parameterized`` fixes that. For everything. Parameterized testing for nose,
|
||||
parameterized testing for py.test, parameterized testing for unittest.
|
||||
|
||||
.. code:: python
|
||||
|
||||
# test_math.py
|
||||
from nose.tools import assert_equal
|
||||
from nose_parameterized import parameterized
|
||||
from parameterized import parameterized
|
||||
|
||||
import unittest
|
||||
import math
|
||||
@@ -92,7 +92,7 @@ Installation
|
||||
|
||||
::
|
||||
|
||||
$ pip install nose-parameterized
|
||||
$ pip install parameterized
|
||||
|
||||
|
||||
Compatibility
|
||||
@@ -100,7 +100,7 @@ Compatibility
|
||||
|
||||
`Yes`__.
|
||||
|
||||
__ https://travis-ci.org/wolever/nose-parameterized
|
||||
__ https://travis-ci.org/wolever/parameterized
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
@@ -160,7 +160,7 @@ iterable:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from nose_parameterized import parameterized, param
|
||||
from parameterized import parameterized, param
|
||||
|
||||
# A list of tuples
|
||||
@parameterized([
|
||||
@@ -208,7 +208,7 @@ functions:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from nose_parameterized import parameterized
|
||||
from parameterized import parameterized
|
||||
|
||||
class AddTest(object):
|
||||
@parameterized([
|
||||
@@ -231,7 +231,7 @@ class is a subclass of ``unittest.TestCase``):
|
||||
.. code:: python
|
||||
|
||||
import unittest
|
||||
from nose_parameterized import parameterized
|
||||
from parameterized import parameterized
|
||||
|
||||
class AddTestCase(unittest.TestCase):
|
||||
@parameterized.expand([
|
||||
@@ -268,7 +268,7 @@ index of the test case parameters in the list of parameters, and ``param``
|
||||
.. code:: python
|
||||
|
||||
import unittest
|
||||
from nose_parameterized import parameterized
|
||||
from parameterized import parameterized
|
||||
|
||||
def custom_name_func(testcase_func, param_num, param):
|
||||
return "%s_%s" %(
|
||||
@@ -301,7 +301,7 @@ case. It can be used to pass keyword arguments to test cases:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from nose_parameterized import parameterized, param
|
||||
from parameterized import parameterized, param
|
||||
|
||||
@parameterized([
|
||||
param("10", 10),
|
||||
@@ -317,7 +317,7 @@ with the ``doc_func`` argument:
|
||||
|
||||
.. code:: python
|
||||
|
||||
from nose_parameterized import parameterized
|
||||
from parameterized import parameterized
|
||||
|
||||
@parameterized([
|
||||
(1, 2, 3),
|
||||
@@ -351,11 +351,27 @@ with the ``doc_func`` argument:
|
||||
OK
|
||||
|
||||
|
||||
Migrating from ``nose-parameterized`` to ``parameterized``
|
||||
----------------------------------------------------------
|
||||
|
||||
To migrate a codebase from ``nose-parameterized`` to ``parameterized``:
|
||||
|
||||
1. Update your requirements file, replacing ``nose-parameterized`` with
|
||||
``parameterized``.
|
||||
|
||||
2. Replace all references to ``nose_parameterized`` with ``parameterized``::
|
||||
|
||||
$ perl -pi -e 's/nose_parameterized/parameterized/g' your-codebase/
|
||||
|
||||
3. You're done!
|
||||
|
||||
|
||||
FAQ
|
||||
---
|
||||
|
||||
If all the major testing frameworks are supported, why is it called ``nose-parameterized``?
|
||||
Originally only nose was supported. But now everything is supported!
|
||||
What happened to ``nose-parameterized``?
|
||||
Originally only nose was supported. But now everything is supported, and it
|
||||
only made sense to change the name!
|
||||
|
||||
What do you mean when you say "nose is best supported"?
|
||||
There are small caveates with ``py.test`` and ``unittest``: ``py.test``
|
||||
@@ -363,8 +379,12 @@ What do you mean when you say "nose is best supported"?
|
||||
instead of ``test_add[1, 2, 3]``), and ``unittest``/``unittest2`` do not
|
||||
support test generators so ``@parameterized.expand`` must be used.
|
||||
|
||||
|
||||
Why not use ``@pytest.mark.parametrize``?
|
||||
Because spelling is difficult. Also, ``nose-parameterized`` doesn't
|
||||
require you to repeat argument names, and (using ``param``) it supports
|
||||
optional keyword arguments.
|
||||
Because spelling is difficult. Also, ``parameterized`` doesn't require you
|
||||
to repeat argument names, and (using ``param``) it supports optional
|
||||
keyword arguments.
|
||||
|
||||
Why do I get an ``AttributeError: 'function' object has no attribute 'expand'`` with ``@parameterized.expand``?
|
||||
You've likely installed the ``parametrized`` (note the missing *e*)
|
||||
package. Use ``parameterized`` (with the *e*) instead and you'll be all
|
||||
set.
|
||||
|
||||
8
setup.py
8
setup.py
@@ -10,12 +10,12 @@ os.chdir(os.path.dirname(sys.argv[0]) or ".")
|
||||
try:
|
||||
long_description = open("README.rst", "U").read()
|
||||
except IOError:
|
||||
long_description = "See https://github.com/wolever/nose-parameterized"
|
||||
long_description = "See https://github.com/wolever/parameterized"
|
||||
|
||||
setup(
|
||||
name="nose-parameterized",
|
||||
version="0.6.dev",
|
||||
url="https://github.com/wolever/nose-parameterized",
|
||||
name="parameterized",
|
||||
version="0.6.0",
|
||||
url="https://github.com/wolever/parameterized",
|
||||
license="FreeBSD",
|
||||
author="David Wolever",
|
||||
author_email="david@wolever.net",
|
||||
|
||||
6
tox.ini
6
tox.ini
@@ -10,6 +10,6 @@ deps=
|
||||
commands=
|
||||
nose: nosetests
|
||||
nose2: nose2
|
||||
pytest: py.test nose_parameterized/test.py
|
||||
unit: python -m unittest nose_parameterized.test
|
||||
unit2: unit2 nose_parameterized.test
|
||||
pytest: py.test parameterized/test.py
|
||||
unit: python -m unittest parameterized.test
|
||||
unit2: unit2 parameterized.test
|
||||
|
||||
Reference in New Issue
Block a user