Skip to content

Commit

Permalink
test for python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
yomichi committed Jun 4, 2024
1 parent 842ef86 commit 8c39c5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on: [push]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
max-parallel: 3
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3,11']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
18 changes: 3 additions & 15 deletions tests/unit/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ def test_get_subset(variable, X, t, Z, index):
assert np.array_equal(var2.Z, Z[index, :])


def test_delete(variable, mocker):
delete_X = mocker.patch("physbo.variable.delete_X")
delete_t = mocker.patch("physbo.variable.delete_t")
delete_Z = mocker.patch("physbo.variable.delete_Z")
variable.delete(1)
delete_X.assert_called_once_with(1)
delete_t.assert_called_once_with(1)
delete_Z.assert_called_once_with(1)


@pytest.mark.parametrize("index", [2, [0, 1]])
def test_delete_X(variable, X, index):
Expand All @@ -68,13 +59,10 @@ def test_delete_Z(variable, Z, index):


def test_add(variable, X, t, Z, mocker):
add_X = mocker.patch("physbo.variable.add_X")
add_t = mocker.patch("physbo.variable.add_t")
add_Z = mocker.patch("physbo.variable.add_Z")
variable.add(X, t, Z)
add_X.assert_called_once_with(X)
add_t.assert_called_once_with(t)
add_Z.assert_called_once_with(Z)
assert np.array_equal(variable.X, np.vstack((X,X)))
assert np.array_equal(variable.t, np.hstack((t,t)))
assert np.array_equal(variable.Z, np.vstack((Z,Z)))


def test_add_X(variable, X):
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
requires = tox>=4
envlist = py37, py38, py39, py310, docs
envlist = py37, py38, py39, py310, py311, docs
isolated_build = true

[gh-actions]
Expand All @@ -9,6 +9,7 @@ python =
'3.8': py38
'3.9': py39
'3.10': py310
'3.11': py311

[testenv]
deps =
Expand Down

0 comments on commit 8c39c5b

Please sign in to comment.