Or call a shared helper for which n_jobs is a parameter.


On 1 April 2014 23:21, Gael Varoquaux <notifications@github.com> wrote:

>  In sklearn/feature_extraction/tests/test_text.py:
>
> > @@ -473,6 +554,109 @@ def test_vectorizer():
> >      assert_raises(ValueError, v3.build_analyzer)
> >
> >
> > +def test_vectorizer_multiprocess():
> > +    # raw documents as an iterator
> > +    train_data = iter(ALL_FOOD_DOCS[:-1])
> > +    test_data = [ALL_FOOD_DOCS[-1]]
> > +    n_train = len(ALL_FOOD_DOCS) - 1
> > +
> > +    # test without vocabulary
> > +    v1 = CountVectorizer(max_df=0.5, n_jobs=2)
> > +    counts_train = v1.fit_transform(train_data)
> > +    if hasattr(counts_train, 'tocsr'):
>
> If tests are exact duplicates, we could simply have a for loop in the
> tests setting n_jobs to 1 and 2.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/scikit-learn/scikit-learn/pull/2923/files#r11157178>
> .
>