Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests #128

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
environment: github-pages
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.13"

- name: Publish to PyPi
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.9
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
# verson 3.7 too old (pylint does not know R0917)
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ code-lint: code-style ## Lint the code
@echo Flake...
@if type flake8 >/dev/null 2>&1 ; then flake8 . ; \
else echo "SKIPPED. Run '$(PIP) install flake8' first." >&2 ; fi

code-check-types: ## Check the code types
@echo Pyright...
@if type pyright >/dev/null 2>&1 ; then PYRIGHT_PYTHON_FORCE_VERSION=latest pyright *.py $(SRC_CORE) $(SRC_TEST) ; \
else echo "SKIPPED. Run 'npm install -f pyright' first." >&2 ; fi
Expand Down
6 changes: 3 additions & 3 deletions docs/things/database.html
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ <h1 class="modulename">
</span><span id="L-207"><a href="#L-207"><span class="linenos"> 207</span></a>
</span><span id="L-208"><a href="#L-208"><span class="linenos"> 208</span></a> <span class="c1"># Core methods</span>
</span><span id="L-209"><a href="#L-209"><span class="linenos"> 209</span></a>
</span><span id="L-210"><a href="#L-210"><span class="linenos"> 210</span></a> <span class="k">def</span> <span class="nf">get_tasks</span><span class="p">(</span> <span class="c1"># pylint: disable=R0914</span>
</span><span id="L-210"><a href="#L-210"><span class="linenos"> 210</span></a> <span class="k">def</span> <span class="nf">get_tasks</span><span class="p">(</span> <span class="c1"># pylint: disable=R0914,R0917</span>
</span><span id="L-211"><a href="#L-211"><span class="linenos"> 211</span></a> <span class="bp">self</span><span class="p">,</span>
</span><span id="L-212"><a href="#L-212"><span class="linenos"> 212</span></a> <span class="n">uuid</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
</span><span id="L-213"><a href="#L-213"><span class="linenos"> 213</span></a> <span class="nb">type</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># pylint: disable=W0622</span>
Expand Down Expand Up @@ -1961,7 +1961,7 @@ <h1 class="modulename">
</span><span id="Database-208"><a href="#Database-208"><span class="linenos">208</span></a>
</span><span id="Database-209"><a href="#Database-209"><span class="linenos">209</span></a> <span class="c1"># Core methods</span>
</span><span id="Database-210"><a href="#Database-210"><span class="linenos">210</span></a>
</span><span id="Database-211"><a href="#Database-211"><span class="linenos">211</span></a> <span class="k">def</span> <span class="nf">get_tasks</span><span class="p">(</span> <span class="c1"># pylint: disable=R0914</span>
</span><span id="Database-211"><a href="#Database-211"><span class="linenos">211</span></a> <span class="k">def</span> <span class="nf">get_tasks</span><span class="p">(</span> <span class="c1"># pylint: disable=R0914,R0917</span>
</span><span id="Database-212"><a href="#Database-212"><span class="linenos">212</span></a> <span class="bp">self</span><span class="p">,</span>
</span><span id="Database-213"><a href="#Database-213"><span class="linenos">213</span></a> <span class="n">uuid</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
</span><span id="Database-214"><a href="#Database-214"><span class="linenos">214</span></a> <span class="nb">type</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># pylint: disable=W0622</span>
Expand Down Expand Up @@ -2391,7 +2391,7 @@ <h6 id="parameters">Parameters</h6>

</div>
<a class="headerlink" href="#Database.get_tasks"></a>
<div class="pdoc-code codehilite"><pre><span></span><span id="Database.get_tasks-211"><a href="#Database.get_tasks-211"><span class="linenos">211</span></a> <span class="k">def</span> <span class="nf">get_tasks</span><span class="p">(</span> <span class="c1"># pylint: disable=R0914</span>
<div class="pdoc-code codehilite"><pre><span></span><span id="Database.get_tasks-211"><a href="#Database.get_tasks-211"><span class="linenos">211</span></a> <span class="k">def</span> <span class="nf">get_tasks</span><span class="p">(</span> <span class="c1"># pylint: disable=R0914,R0917</span>
</span><span id="Database.get_tasks-212"><a href="#Database.get_tasks-212"><span class="linenos">212</span></a> <span class="bp">self</span><span class="p">,</span>
</span><span id="Database.get_tasks-213"><a href="#Database.get_tasks-213"><span class="linenos">213</span></a> <span class="n">uuid</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
</span><span id="Database.get_tasks-214"><a href="#Database.get_tasks-214"><span class="linenos">214</span></a> <span class="nb">type</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="c1"># pylint: disable=W0622</span>
Expand Down
2 changes: 2 additions & 0 deletions tests/test_things.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import io
import os
import time
import tracemalloc
import sqlite3
import unittest
import unittest.mock

import things
import things.database

tracemalloc.start()

TEST_DATABASE_FILEPATH = "tests/main.sqlite"
TEST_DATABASE_FILEPATH_2022 = "tests/db2022/main.sqlite"
Expand Down
2 changes: 1 addition & 1 deletion things/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __init__(self, filepath=None, print_sql=False):

# Core methods

def get_tasks( # pylint: disable=R0914
def get_tasks( # pylint: disable=R0914,R0917
self,
uuid: Optional[str] = None,
type: Optional[str] = None, # pylint: disable=W0622
Expand Down
Loading