Completed
Push — master ( db2bdb...52f8b4 )
by Amresh
01:56 queued 46s
created

fastest.file_handler.make_test_dir   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A make_test_module() 0 14 2
1
import os
2
3
4
def make_test_module():
5
    """
6
    A function with side-effect of creating a python module
7
    for containing tests at the root of a project.
8
    """
9
    if os.path.exists('./test'):
10
        return None
11
    # If there is a test module present
12
    # at the target location, exit.
13
14
    os.mkdir('./test')
15
    # If there is no `test` module, create one
16
17
    open('./test/__init__.py', 'a').close()
18
    # Create an __init__.py so that
19
    # the dir is identified as a python module
20