diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-03-11 22:28:43 +0100 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2013-03-11 22:28:43 +0100 |
commit | de3a552eab032cb980a2fb78976fc3dc8cd5f1c8 (patch) | |
tree | 1eb5e3cbc27f5abd9c9d4b1729c152a1db97c3ee /factory | |
parent | e2ac08066fbc6b6412b713b42aba792c224067f5 (diff) | |
download | factory-boy-de3a552eab032cb980a2fb78976fc3dc8cd5f1c8.tar factory-boy-de3a552eab032cb980a2fb78976fc3dc8cd5f1c8.tar.gz |
Remove InfiniteIterator and infinite_iterator.
Use Iterator/iterator instead.
Diffstat (limited to 'factory')
-rw-r--r-- | factory/__init__.py | 2 | ||||
-rw-r--r-- | factory/declarations.py | 23 |
2 files changed, 0 insertions, 25 deletions
diff --git a/factory/__init__.py b/factory/__init__.py index db88f4e..4b4857c 100644 --- a/factory/__init__.py +++ b/factory/__init__.py @@ -50,7 +50,6 @@ from .base import ( from .declarations import ( LazyAttribute, Iterator, - InfiniteIterator, Sequence, LazyAttributeSequence, SelfAttribute, @@ -63,7 +62,6 @@ from .declarations import ( lazy_attribute, iterator, - infinite_iterator, sequence, lazy_attribute_sequence, container_attribute, diff --git a/factory/declarations.py b/factory/declarations.py index efaadbe..1f64038 100644 --- a/factory/declarations.py +++ b/factory/declarations.py @@ -156,21 +156,6 @@ class Iterator(OrderedDeclaration): return self.getter(value) -class InfiniteIterator(Iterator): - """Same as Iterator, but make the iterator infinite by cycling at the end. - - Attributes: - iterator (iterable): the iterator, once made infinite. - """ - - def __init__(self, iterator): - warnings.warn( - "factory.InfiniteIterator is deprecated, and will be removed in the " - "future. Please use factory.Iterator instead.", - PendingDeprecationWarning, 2) - return super(InfiniteIterator, self).__init__(iterator, cycle=True) - - class Sequence(OrderedDeclaration): """Specific OrderedDeclaration to use for 'sequenced' fields. @@ -524,14 +509,6 @@ def iterator(func): """Turn a generator function into an iterator attribute.""" return Iterator(func()) -def infinite_iterator(func): - """Turn a generator function into an infinite iterator attribute.""" - warnings.warn( - "@factory.infinite_iterator is deprecated and will be removed in the " - "future. Please use @factory.iterator instead.", - PendingDeprecationWarning, 2) - return InfiniteIterator(func()) - def sequence(func): return Sequence(func) |