Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
fix directly called pytest fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
Ohjeah committed Apr 6, 2019
1 parent de385f1 commit 75c7222
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/util/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import itertools
import collections
import itertools
import random

import pytest
Expand Down Expand Up @@ -53,11 +53,13 @@ def test_pareto_front_attrs():
assert bmin <= m.b <= bmax


def _models():
return [(0, 0), (0, 1), (1, 0), (0.5, 0.5), (1, 1)]


@pytest.fixture(scope="function")
def models():

m = [(0, 0), (0, 1), (1, 0), (0.5, 0.5), (1, 1)]
return m
return _models()


def test_pareto_front_tpl(models):
Expand All @@ -79,7 +81,7 @@ def test_pareto_front_duplicates():
assert False


cd_cases = ((models()[1:-1], ()), ([Model(a, b) for (a, b) in sorted(models()[1:-1])], ("a", "b")))
cd_cases = ((_models()[1:-1], ()), ([Model(a, b) for (a, b) in sorted(_models()[1:-1])], ("a", "b")))


@pytest.mark.parametrize("cd_case", cd_cases)
Expand Down

0 comments on commit 75c7222

Please sign in to comment.