Skip to content
This repository was archived by the owner on Jul 22, 2019. It is now read-only.

Commit eda7d1d

Browse files
committed
tests: pep257 to pydocstyle
Signed-off-by: Tibor Simko <[email protected]>
1 parent 49c4e3b commit eda7d1d

File tree

7 files changed

+18
-51
lines changed

7 files changed

+18
-51
lines changed

Diff for: .travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is part of Flask-AppFactory
2-
# Copyright (C) 2015 CERN.
2+
# Copyright (C) 2015, 2016 CERN.
33
#
44
# Flask-AppFactory is free software; you can redistribute it and/or
55
# modify it under the terms of the Revised BSD License; see LICENSE
@@ -24,13 +24,13 @@ cache:
2424

2525
install:
2626
# Install test dependencies
27-
- "travis_retry pip install coveralls pep257 Sphinx twine wheel"
27+
- "travis_retry pip install coveralls pydocstyle Sphinx twine wheel"
2828
- "travis_retry pip install pytest pytest-pep8 pytest-cov pytest-cache"
2929
- "travis_retry pip install -r requirements.${REQUIREMENTS}.txt"
30-
- "travis_retry pip install -e ."
30+
- "travis_retry pip install -e .[docs,tests]"
3131

3232
script:
33-
- pep257 flask_appfactory
33+
- pydocstyle flask_appfactory
3434
- "sphinx-build -qnNW docs docs/_build/html"
3535
- python setup.py test
3636
- "sphinx-build -qnNW -b doctest docs docs/_build/doctest"

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pip install Flask \
1818
coveralls \
1919
ipython \
2020
itsdangerous \
21-
pep257 \
21+
pydocstyle \
2222
pytest \
2323
pytest-cache \
2424
pytest-cov \

Diff for: flask_appfactory/cli.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
33
# This file is part of Flask-AppFactory
4-
# Copyright (C) 2015 CERN.
4+
# Copyright (C) 2015, 2016 CERN.
55
#
66
# Flask-AppFactory is free software; you can redistribute it and/or
77
# modify it under the terms of the Revised BSD License; see LICENSE
@@ -19,7 +19,6 @@
1919

2020

2121
class CLIDiscoveryRegistry(ModuleAutoDiscoveryRegistry):
22-
2322
"""Discover CLI modules and register them on a command collection.
2423
2524
Searches for a variable ``commands`` in a module ``cli`` in each package.

Diff for: flask_appfactory/ext/jinja2.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
33
# This file is part of Flask-AppFactory
4-
# Copyright (C) 2015 CERN.
4+
# Copyright (C) 2015, 2016 CERN.
55
#
66
# Flask-AppFactory is free software; you can redistribute it and/or
77
# modify it under the terms of the Revised BSD License; see LICENSE
@@ -43,7 +43,6 @@ def blueprint_is_module(blueprint):
4343

4444

4545
class OrderAwareDispatchingJinjaLoader(DispatchingJinjaLoader):
46-
4746
"""Order aware dispatching Jinja loader.
4847
4948
Customization of default Flask Jinja2 template loader. By default the

Diff for: run-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# modify it under the terms of the Revised BSD License; see LICENSE
66
# file for more details.
77

8-
pep257 flask_appfactory && \
8+
pydocstyle flask_appfactory && \
99
sphinx-build -qnNW docs docs/_build/html && \
1010
python setup.py test && \
1111
sphinx-build -qnNW -b doctest docs docs/_build/doctest

Diff for: setup.cfg

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is part of Flask-AppFactory
2-
# Copyright (C) 2015 CERN.
2+
# Copyright (C) 2015, 2016 CERN.
33
#
44
# Flask-AppFactory is free software; you can redistribute it and/or
55
# modify it under the terms of the Revised BSD License; see LICENSE
@@ -12,3 +12,6 @@ universal=1
1212
source-dir = docs/
1313
build-dir = docs/_build
1414
all_files = 1
15+
16+
[aliases]
17+
test = pytest

Diff for: setup.py

+6-40
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
#
33
# This file is part of Flask-AppFactory
4-
# Copyright (C) 2015 CERN.
4+
# Copyright (C) 2015, 2016 CERN.
55
#
66
# Flask-AppFactory is free software; you can redistribute it and/or
77
# modify it under the terms of the Revised BSD License; see LICENSE
@@ -14,42 +14,6 @@
1414
import sys
1515

1616
from setuptools import setup
17-
from setuptools.command.test import test as TestCommand
18-
19-
20-
class PyTest(TestCommand):
21-
22-
"""Integration of PyTest with setuptools."""
23-
24-
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
25-
26-
def initialize_options(self):
27-
"""Initialize options."""
28-
TestCommand.initialize_options(self)
29-
try:
30-
from ConfigParser import ConfigParser
31-
except ImportError:
32-
from configparser import ConfigParser
33-
config = ConfigParser()
34-
config.read("pytest.ini")
35-
self.pytest_args = config.get("pytest", "addopts").split(" ")
36-
37-
def finalize_options(self):
38-
"""Finalize options."""
39-
TestCommand.finalize_options(self)
40-
self.test_args = []
41-
self.test_suite = True
42-
43-
def run_tests(self):
44-
"""Run tests."""
45-
# import here, cause outside the eggs aren't loaded
46-
import pytest
47-
import _pytest.config
48-
pm = _pytest.config.get_plugin_manager()
49-
pm.consider_setuptools_entrypoints()
50-
errno = pytest.main(self.pytest_args)
51-
sys.exit(errno)
52-
5317
# Get the version string. Cannot be done with import!
5418
with open(os.path.join('flask_appfactory', 'version.py'), 'rt') as f:
5519
version = re.search(
@@ -61,8 +25,9 @@ def run_tests(self):
6125
'pytest-cache>=1.0',
6226
'pytest-cov>=1.8.0',
6327
'pytest-pep8>=1.0.6',
64-
'pytest>=2.6.1',
65-
'coverage<4.0a1',
28+
'pytest-runner>=2.7.0',
29+
'pytest>=2.8.0',
30+
'coverage>=4.0',
6631
]
6732

6833
setup(
@@ -85,8 +50,9 @@ def run_tests(self):
8550
],
8651
extras_require={
8752
'celery': ['Flask-CeleryExt>=0.1.0'],
53+
'docs': ['Sphinx'],
54+
'tests': tests_require,
8855
},
89-
cmdclass={'test': PyTest},
9056
classifiers=[
9157
'Programming Language :: Python :: 2',
9258
'Programming Language :: Python :: 2.6',

0 commit comments

Comments
 (0)