From a5f1656420ca847ce2a20c5ed41d9c670ad09745 Mon Sep 17 00:00:00 2001 From: Edmond Chuc Date: Fri, 21 Jan 2022 01:38:41 +1000 Subject: [PATCH 1/3] Add running tests and cov in README.rst --- README.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.rst b/README.rst index 3cbf5fe..c437fa9 100644 --- a/README.rst +++ b/README.rst @@ -110,6 +110,20 @@ Installation poetry install +Running tests +------------- + +.. code-block:: bash + + poetry run pytest + +Coverage +-------- + +.. code-block:: bash + + poetry run pytest --cov=flask_htmx tests/ + Docs ---- From 8d0e21b9f161585eccc1176e1a0596e7560abb14 Mon Sep 17 00:00:00 2001 From: Edmond Chuc Date: Fri, 21 Jan 2022 01:38:48 +1000 Subject: [PATCH 2/3] Delete run.py --- run.py | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 run.py diff --git a/run.py b/run.py deleted file mode 100644 index 1175963..0000000 --- a/run.py +++ /dev/null @@ -1,20 +0,0 @@ -from flask import Flask, render_template -from flask_htmx import HTMX - -app = Flask(__name__) -htmx = HTMX() -htmx.init_app(app) - - -@app.route("/") -def home(): - print("Home route.") - if htmx: - print("It was a HTMX request.") - else: - print("It was NOT a HTMX request.") - return render_template("index.html") - - -if __name__ == "__main__": - app.run(debug=True) From 11d18cbced369162f37e01869a6d309342395c33 Mon Sep 17 00:00:00 2001 From: Edmond Chuc Date: Fri, 21 Jan 2022 01:39:13 +1000 Subject: [PATCH 3/3] Update release.yml to run test coverage only on flask_htmx package --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8943a74..d2a890c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: - name: Run pytest run: | - poetry run pytest --cov=./ --cov-report=xml + poetry run pytest --cov=flask_htmx --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v2