From d015451e551c0ddb1aeab02060c0bdfa185886fe Mon Sep 17 00:00:00 2001 From: SouthFox Date: Thu, 8 Jun 2023 16:54:36 +0800 Subject: [PATCH] [lint] fix lint --- app.py | 4 +++- tests/conftest.py | 8 ++++++-- tests/test_index.py | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index a4ad1c2..65d7efa 100644 --- a/app.py +++ b/app.py @@ -1,9 +1,11 @@ #!/usr/bin/env python3 +"""Creatr App""" from flask import Flask app = Flask(__name__) @app.route('/') -def hello(): +def index(): + """Show index page""" return "Hello Fediverse!" diff --git a/tests/conftest.py b/tests/conftest.py index 9eeaa81..76ce539 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,13 +1,17 @@ #!/usr/bin/env python3 +"""Build test fixture""" + import pytest from app import app as flask_app -@pytest.fixture -def app(): +@pytest.fixture(name="app") +def fixture_app(): + """Build flask app""" yield flask_app @pytest.fixture def client(app): + """Build test client""" return app.test_client() diff --git a/tests/test_index.py b/tests/test_index.py index 0c9edb6..e6e4b7f 100644 --- a/tests/test_index.py +++ b/tests/test_index.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +"""Test App index""" def test_request_example(client): + """Test index path""" response = client.get("/") assert b"Hello Fediverse!" in response.data