Passed
Push — master ( 8b2ed0...4823d2 )
by Daniel
03:53
created

conftest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 18
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A reference_data() 0 15 3
A root_dir() 0 3 1
1
import pytest
2
import os
3
import pickle
4
5
6
@pytest.fixture(scope='session', autouse=True)
7
def root_dir():
8
    return r'tests\data'
9
10
11
@pytest.fixture(scope='session', autouse=True)
12
def reference_data(root_dir):
13
14
    filenames = {   # .pkl files with PeriodicSets.
15
        'cubic':           'cubic',
16
        'T2_experimental': 'T2_experimental',
17
        'CSD_families':    'CSD_families',
18
    }
19
20
    refs = {}
21
    for name in filenames:
22
        with open(os.path.join(root_dir, filenames[name] + '.pkl'), 'rb') as f:
23
            refs[name] = pickle.load(f)
24
25
    return refs
26