Skip to content

Commit

Permalink
unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kbirger committed Apr 5, 2024
1 parent f78a619 commit fc427a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 63 deletions.
62 changes: 3 additions & 59 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- os: ubuntu
python-version: "pypy3.9"
- os: ubuntu
python-version: "pypy3.10"

os: [ubuntu, windows]
python-version: ["3.12"]
env:
OS: ${{ matrix.os }}
DEPS: yes
Expand All @@ -109,22 +103,7 @@ jobs:

- run: mkdir coverage

- name: test without deps
# speed up by skipping this step on pypy
if: "!startsWith(matrix.python-version, 'pypy')"
run: make test
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-without-deps
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-without-deps

- name: install extra deps
run: pdm install -G testing-extra -G email

- name: test with deps
run: make test
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-with-deps
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-with-deps
- run: pytest -v --doctest-modules --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html

- name: store coverage files
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -234,41 +213,6 @@ jobs:
name: coverage-html
path: htmlcov

test-typing-extensions:
name: test typing-extensions ${{ matrix.typing-extensions-version }} on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# test the oldest supported version and main
typing-extensions-version: ["4.6.1", "main"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
allow-python-prereleases: true

- name: install deps
run: |
pdm venv create --with-pip --force $PYTHON
pdm install -G testing -G email
- name: install typing-extensions
run: |
if [ ${{ matrix.typing-extensions-version }} == 'main' ]; then
pdm remove typing-extensions && pdm add 'typing-extensions @ git+https://github.com/python/typing_extensions.git'
else
pdm remove typing-extensions && pdm add 'typing-extensions==${{ matrix.typing-extensions-version }}'
fi
pdm list
- name: test
run: make test

# https://github.com/marketplace/actions/alls-green
check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
8 changes: 4 additions & 4 deletions smarter_kettle_client/dict_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def patch_dict(target: dict, path: str, patch: dict) -> dict:

if child is None:
parent.update(patch)

parent[child].update(patch)
else:
parent[child].update(patch)

return new_dict

Expand All @@ -45,8 +45,8 @@ def put_dict(target: dict, path: str, put: dict) -> dict:

if child is None:
return put

parent[child] = put
else:
parent[child] = put

return new_dict

Expand Down

0 comments on commit fc427a5

Please sign in to comment.