Skip to content

Commit d124292

Browse files
authored
Merge pull request scalative#179 from scalative/tox-flake8
Run flake8 with tox
2 parents 1afb3a8 + 6e25728 commit d124292

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ matrix:
3333
language: shell
3434
env: TOXPY36="/usr/local/bin/python3" TOXENV="cp36"
3535
python: "3.6"
36+
- dist: xenial
37+
python: "3.7"
38+
env: TOXENV="flake8"
3639

3740
allow_failures:
3841
- os: osx
@@ -65,6 +68,9 @@ notifications:
6568
6669

6770
after_success:
68-
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install "idna < 2.8"; fi
69-
- pip install coveralls
70-
- coveralls
71+
- |
72+
if [[ "$TOXENV" != "flake8" ]]; then
73+
if [[ "$TRAVIS_PYTHON_VERSION" == "2.6" ]]; then pip install "idna < 2.8"; fi
74+
pip install coveralls
75+
coveralls
76+
fi

haas/plugin_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
import sys
1010
import logging
1111

12+
from stevedore.extension import ExtensionManager
13+
14+
from .utils import uncamelcase
15+
1216
if sys.version_info < (2, 7): # pragma: no cover
1317
from ordereddict import OrderedDict
1418
else: # pragma: no cover
1519
from collections import OrderedDict
1620

17-
from stevedore.extension import ExtensionManager
18-
19-
from .utils import uncamelcase
20-
2121
logger = logging.getLogger(__name__)
2222

2323

haas/plugins/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run(self, result_collector, test):
5353
warnings.filterwarnings(
5454
'module',
5555
category=DeprecationWarning,
56-
message='Please use assert\w+ instead.')
56+
message=r'Please use assert\w+ instead.')
5757
result_collector.startTestRun()
5858
try:
5959
test(result_collector)

haas/tests/test_loader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def test_raises_for_test_suite(self):
4444

4545
def test_create_custom_class(self):
4646
loader = Loader(test_case_class=_test_case_data.TestCaseSubclass)
47-
test = loader.load_test(_test_case_data.TestCaseSubclass, 'test_method')
47+
test = loader.load_test(
48+
_test_case_data.TestCaseSubclass, 'test_method')
4849
self.assertIsInstance(test, _test_case_data.TestCaseSubclass)
4950

5051
def test_create_custom_class_raises(self):

haas/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_module_by_name(name):
5959

6060

6161
def uncamelcase(string, sep='_'):
62-
replace = '\g<before>{0}\g<caps>'.format(sep)
62+
replace = r'\g<before>{0}\g<caps>'.format(sep)
6363
temp = UNCAMELCASE_FIRST_PASS.sub(replace, string)
6464
return UNCAMELCASE_SECOND_PASS.sub(replace, temp).lower()
6565

tox.ini

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = cp{26,27,33,34,35},pp{2,3},cp26-win
2+
envlist = cp{26,27,33,34,35},pp{2,3},cp26-win,flake8
33
minversion=2.7
44

55
[testenv]
@@ -52,3 +52,16 @@ commands =
5252
# The tox environment for cp33 needs a specific set of base
5353
# dependencies for wheel, pip and setuptools
5454
deps = -rcp33-tox-requirements.txt
55+
56+
[testenv:flake8]
57+
basepython = python3
58+
skip_install = true
59+
deps = flake8
60+
commands = flake8
61+
62+
[flake8]
63+
exclude =
64+
.tox,
65+
.git,
66+
__pycache__,
67+
docs/source/conf.py

0 commit comments

Comments
 (0)