From 676b93420cf0a395b57134884056d59abf2cdf22 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Sun, 9 Jun 2024 12:35:14 +0400 Subject: [PATCH] test for Python code --- .github/workflows/test_python.yml | 21 +++++++++++++++++++++ tests/python/__init__.py | 0 tests/python/test_trivial.py | 9 ++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test_python.yml create mode 100644 tests/python/__init__.py diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml new file mode 100644 index 0000000..2371b26 --- /dev/null +++ b/.github/workflows/test_python.yml @@ -0,0 +1,21 @@ +name: "ci" + +on: + push + +jobs: + test: + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + python-version: ['3.9', '3.10', '3.11', '3.12' ] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: ./actions/test + with: + python-version: ${{ matrix.python-version }} + #source-folder: "tests/python" diff --git a/tests/python/__init__.py b/tests/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/python/test_trivial.py b/tests/python/test_trivial.py index 9e19b22..3989b07 100644 --- a/tests/python/test_trivial.py +++ b/tests/python/test_trivial.py @@ -1,3 +1,10 @@ +from cvx.dog import Dog + + def test_trivial(): assert True - + + +def test_dog(): + dog = Dog(name="Peter Maffay") + assert dog.name == "Peter Maffay"