forked from OpenSlides/openslides-csv-export
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
44 lines (33 loc) · 924 Bytes
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- coding: utf-8 -*-
import sys
from fabric.api import local
from fabric.contrib import django
def check():
"""
Checks for PEP 8 and other errors in openslides_csv_export and in tests.
"""
local('flake8 --max-line-length=150 --statistics openslides_csv_export')
local('flake8 --max-line-length=150 --statistics tests')
def test(module='tests'):
"""
Runs the unit tests.
"""
sys.path.insert(0, '')
django.settings_module('tests.settings')
sys.argv.pop()
sys.argv.extend(['test', module])
from django.core import management
management.execute_from_command_line()
def prepare_commit():
"""
Does everything that should be done before a commit.
At the moment it is running the tests and checks for PEP 8 and other errors.
"""
test()
check()
def travis_ci():
"""
Command that is run by Travis CI.
"""
test()
check()