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

conftest.root_dir()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 0
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