Repository: melissawm/sphinx-tags (language: python)

Issue:
Add tests
For now, the documentation itself serves as tests for the current features, but this doesn't test (for example) the use of symlinked directories. We should have a proper test suite for the extension.


Discussion / hints:
I think there are two options for this:
1. Unit test: mock everything (Sphinx app and config objects, etc.), and test individual classes and functions
2. Integration test: Use a full build environment with some test source files and expected HTML output

Option 1 would probably be more straightforward to write (without much knowledge of Sphinx internals), but option 2 would be more thorough. I'm not sure how best to set up a build environment for testing, but I'm curious, so I'm willing to look into it.

Sphinx has a `sphinx.testing` subpackage that doesn't appear to be documented, but looks potentially useful: https://github.com/sphinx-doc/sphinx/tree/master/sphinx/testing
`sphinx.testing` looks like the best option for most of the things we would want to test. If that sounds good to you, I'll plan on getting that started with a few basic tests.
I'd be happy to see that, thanks!

Fix patch:
diff --git a/README.md b/README.md
index acf519e..6c14326 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# sphinx-tags [![sphinx-tags](https://circleci.com/gh/melissawm/sphinx-tags.svg?style=svg)](https://circleci.com/gh/melissawm/sphinx-tags)
+# sphinx-tags [![sphinx-tags](https://circleci.com/gh/melissawm/sphinx-tags.svg?style=svg)](https://circleci.com/gh/melissawm/sphinx-tags) ![Codecov](https://img.shields.io/codecov/c/github/melissawm/sphinx-tags)
 
 A tiny Sphinx extension that implements blog-style tags for documentation.
 


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
new file mode 100644
index 0000000..e83c13a
--- /dev/null
+++ b/.github/workflows/tests.yaml
@@ -0,0 +1,34 @@
+name: Run tests
+
+on:
+  # Triggers the workflow on push events but only for the "main" branch
+  push:
+    branches: [ "main" ]
+
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+
+  run-tests:
+    # The type of runner that the job will run on
+    runs-on: ubuntu-latest
+
+    # Steps represent a sequence of tasks that will be executed as part of the job
+    steps:
+
+      - uses: actions/checkout@v3
+      - uses: actions/setup-python@v4
+        with:
+          python-version: '3.11'
+      - run: pip install ."[dev, sphinx]"
+
+      - name: Run tests
+        run: |
+          pytest
+
+      - name: Upload coverage reports to Codecov
+        uses: codecov/codecov-action@v3
+        env:
+          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}