all python files are now formated with black (#106)

* all python files are now formated with black

NOTE:
some configurations where necessary. flake8 line-length has to be set to 88
which is the default for black. but this was not enough some lines of black
where formated longer then 88 characters. found flake8-bugbear with B950.

with that and in combination with ignore=E501 it is possible to ignore long
lines, but if there are lines to long it will still point it out.

further also for isort some configuration was necessary

REFERENCES:
https://github.com/psf/black/blob/master/docs/compatible_configs.md#isort
https://github.com/psf/black/blob/master/docs/compatible_configs.md#flake8
https://github.com/PyCQA/flake8-bugbear#opinionated-warnings

* removed commented import statments

Co-authored-by: Christoph Ladurner <christoph.ladurner@tugraz.at>
This commit is contained in:
Christoph Ladurner
2020-10-14 14:10:05 +02:00
committed by GitHub
parent f9993369f2
commit 95f566d48d
11 changed files with 209 additions and 193 deletions
+3 -3
View File
@@ -24,10 +24,9 @@ from invenio_i18n import InvenioI18N
from invenio_search import InvenioSearch
from invenio_theme_tugraz import InvenioThemeTugraz
from invenio_theme_tugraz.views import blueprint
@pytest.fixture(scope='module')
@pytest.fixture(scope="module")
def celery_config():
"""Override pytest-invenio fixture.
@@ -43,7 +42,7 @@ def app(request):
app = Flask("testapp")
DB = os.getenv("SQLALCHEMY_DATABASE_URI", "sqlite://")
app.config.update(
I18N_LANGUAGES=[('en', 'English'), ('de', 'German')],
I18N_LANGUAGES=[("en", "English"), ("de", "German")],
SQLALCHEMY_DATABASE_URI=DB,
SQLALCHEMY_TRACK_MODIFICATIONS=False,
)
@@ -51,6 +50,7 @@ def app(request):
InvenioDB(app)
InvenioSearch(app)
InvenioThemeTugraz(app)
InvenioI18N(app)
with app.app_context():
db_url = str(db.engine.url)
+6 -5
View File
@@ -16,20 +16,21 @@ from invenio_theme_tugraz import InvenioThemeTugraz
def test_version():
"""Test version import."""
from invenio_theme_tugraz import __version__
assert __version__
def test_init():
"""Test extension initialization."""
app = Flask('testapp')
app = Flask("testapp")
ext = InvenioThemeTugraz(app)
assert 'invenio-theme-tugraz' in app.extensions
assert "invenio-theme-tugraz" in app.extensions
app = Flask('testapp')
app = Flask("testapp")
ext = InvenioThemeTugraz()
assert 'invenio-theme-tugraz' not in app.extensions
assert "invenio-theme-tugraz" not in app.extensions
ext.init_app(app)
assert 'invenio-theme-tugraz' in app.extensions
assert "invenio-theme-tugraz" in app.extensions
def test_app(app):