nose-ittr
nose extension for supporting parametrized testing.
Allows developer to run the same test over and over again using different values
- Main Features:
Very easy to integrate with existing tests
Saves a lot of boilerplate code, and code replication
Work with all nose plugins (including multiprocessing)
Customize setup per test, by using this package built-in nose plugin setup-ittr
Installation:
pip install nose_ittr
Basic usage:
import math
from nose.tools import assert_equal, assert_not_equal
from nose_ittr import IttrMultiplier, ittr
class TestFoo(object):
__metaclass__ = IttrMultiplier
def setup(self):
if hasattr(self, 'value'):
self.value += 3
def teardown(self):
pass
@ittr(number=[1, 2, 3, 4])
def test_even(self):
assert_equal(self.number % 2, 0)
@ittr(numerator=[15, 6], denominator=[2, 3])
def test_no_remainder(self):
assert_equal(self.numerator % self.denominator, 0)
@ittr(value=[4, 14])
def test_prime_with_custom_setup(self):
for i in range(3, int(math.sqrt(self.value))):
assert_not_equal(self.value % i, 0)
nosetests --with-setup-ittr [for setup customization support]
result:
TestFoo.test_even_1 ... FAIL
TestFoo.test_even_2 ... .ok
TestFoo.test_even_3 ... FAIL
TestFoo.test_even_4 ... .ok
TestFoo.test_no_remainder_2_6 ... .ok
TestFoo.test_no_remainder_2_15 ... FAIL
TestFoo.test_no_remainder_3_6 ... .ok
TestFoo.test_no_remainder_3_15 ... .ok
TestFoo.test_prime_with_custom_setup_14 ... ok
TestFoo.test_prime_with_custom_setup_4 ... ok
- Notes:
Doesn’t affect test docstring if used with -v parameter.
To change the docstring printout based on the varibales passed to test, use the plugin nose-docstring-modifier.
- Authors:
Sergey Ragatsky
- Contributors:
Niv Mizrahi
Tal Ben Basat
Nicole Franco
Roy Klinger
Maroun Maroun
0.0.1 (2014-11-26)
Initial release
0.0.2 (2014-11-27)
Added nose plugin to the package to support setup customization per test
0.0.3 (2014-11-27)
Error handling for nose plugin
Typo fix
Support using new.classob
0.0.4 (2014-12-02)
New feature, that allows decorating all class method with ‘__ittr__’ hook
Metadata
Release files for nose_ittr 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nose_ittr-0.0.4.tar.gz | 4.6 kB | Without provenance | Details |
Release files / nose_ittr-0.0.4.tar.gz
| Download URL | nose_ittr-0.0.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79b3f480c3040c9a67b8e12e97f17aac37f365e32a4208ed275b920dfc2ea8f2
|
|
BLAKE2b-256 checksum How to use checksums |
e69d9dca6de03280fceabade4c02c6cb35892d072e9712d1b33a3bccac118d15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for nose_ittr 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.