From e56c86d44ec2a55a28e3171a6c48861951a76f1b Mon Sep 17 00:00:00 2001 From: Tai Sakuma Date: Sun, 18 Nov 2018 12:09:37 +0000 Subject: [PATCH] turn a fixture tree() into a function mk_tree() for pytest 4 --- .../modules/test_with_count_combination.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/unit/selection/modules/test_with_count_combination.py b/tests/unit/selection/modules/test_with_count_combination.py index d543f95c..49875a89 100644 --- a/tests/unit/selection/modules/test_with_count_combination.py +++ b/tests/unit/selection/modules/test_with_count_combination.py @@ -17,8 +17,7 @@ def __call__(self, event): pass def end(self): pass ##__________________________________________________________________|| -@pytest.fixture() -def tree(): +def mk_tree(): # all0 - all1 --- all2 --- sel1 # | +- sel2 # +- not1 --- any1 --- all3 --- sel3 @@ -65,7 +64,9 @@ def tree(): ) ##__________________________________________________________________|| -def test_combination(tree): +def test_combination(): + + tree = mk_tree() all0 = tree['alls'][0] sels = tree['sels'] @@ -112,11 +113,11 @@ def test_merge(): # deep.copy() is not used because it will be difficult to access # to copied sels - tree0 = tree() + tree0 = mk_tree() all0 = tree0['alls'][0] - tree0_copy1 = tree() - tree0_copy2 = tree() + tree0_copy1 = mk_tree() + tree0_copy2 = mk_tree() all0_copy1 = tree0_copy1['alls'][0] all0_copy2 = tree0_copy2['alls'][0]