Skip to main content

Add my little script for running Python tests in FF projects

ID
1b32507
date
2024-04-17 15:32:18+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
83dce10
message
Add my little script for running Python tests in FF projects
changed files
2 files, 30 additions, 1 deletion

Changed files

flickr/README.md (1116) → flickr/README.md (1603)

diff --git a/flickr/README.md b/flickr/README.md
index e4248e9..ad79fba 100644
--- a/flickr/README.md
+++ b/flickr/README.md
@@ -25,6 +25,12 @@ scripts = [
         deploy a new version of a Flickr Foundation Python library: bump the version, tag the Git commit, push to PyPI and GitHub.
         """,
     },
+    {
+        "usage": "ts",
+        "description": """
+        run <strong>t</strong>est<strong>s</strong> in a Flickr Foundation Python project (including linting, autoformatting, pytest tests)
+        """,
+    },
 ]
 
 cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
@@ -39,5 +45,14 @@ cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
   <dd>
     deploy a new version of a Flickr Foundation Python library: bump the version, tag the Git commit, push to PyPI and GitHub.
   </dd>
+
+  <dt>
+    <a href="https://github.com/alexwlchan/scripts/blob/main/flickr/ts">
+      <code>ts</code>
+    </a>
+  </dt>
+  <dd>
+    run <strong>t</strong>est<strong>s</strong> in a Flickr Foundation Python project (including linting, autoformatting, pytest tests)
+  </dd>
 </dl>
-<!-- [[[end]]] (checksum: 25a2e0861d7f789ae830f7da3763f089) -->
+<!-- [[[end]]] (checksum: 6f1984b029c50abbbd12d74d6f1b07bb) -->

flickr/ts (0) → flickr/ts (243)

diff --git a/flickr/ts b/flickr/ts
new file mode 100755
index 0000000..af4c515
--- /dev/null
+++ b/flickr/ts
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+
+export FLICKR_API_KEY=$(keyring get flickr_api key)
+
+black .
+flake8 --exclude .venv --ignore=E501,E203,W503 --extend-select=W504
+
+mypy src tests
+
+coverage run -m pytest tests
+coverage report