From a20a054c0fcb7c8b5bff79bf1bb25132d3d491e9 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 19 Jan 2023 16:00:26 +0000 Subject: [PATCH] CI: Fix CI workflow. --- .github/workflows/test.yml | 4 ++-- library/tests/test_setup.py | 11 +++++++---- library/tox.ini | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80e0cd0..f8c398c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [3.5, 3.6, 3.7, 3.8] + python: [3.7, 3.9] steps: - uses: actions/checkout@v2 @@ -33,5 +33,5 @@ jobs: run: | python -m pip install coveralls coveralls --service=github - if: ${{ matrix.python == '3.8' }} + if: ${{ matrix.python == '3.9' }} diff --git a/library/tests/test_setup.py b/library/tests/test_setup.py index 1e8ecb1..988ca53 100644 --- a/library/tests/test_setup.py +++ b/library/tests/test_setup.py @@ -8,7 +8,7 @@ def test_moisture_setup(GPIO, smbus): ch2 = Moisture(channel=2) ch3 = Moisture(channel=3) - assert GPIO.setup.has_calls([ + GPIO.setup.assert_has_calls([ mock.call(ch1._gpio_pin, GPIO.IN), mock.call(ch2._gpio_pin, GPIO.IN), mock.call(ch3._gpio_pin, GPIO.IN) @@ -34,14 +34,17 @@ def test_pump_setup(GPIO, smbus): ch2 = Pump(channel=2) ch3 = Pump(channel=3) - assert GPIO.setup.has_calls([ + GPIO.setup.assert_has_calls([ mock.call(ch1._gpio_pin, GPIO.OUT, initial=GPIO.LOW), mock.call(ch2._gpio_pin, GPIO.OUT, initial=GPIO.LOW), mock.call(ch3._gpio_pin, GPIO.OUT, initial=GPIO.LOW) ]) - assert GPIO.PWM.has_calls([ + GPIO.PWM.assert_has_calls([ mock.call(ch1._gpio_pin, PUMP_PWM_FREQ), + mock.call().start(0), mock.call(ch2._gpio_pin, PUMP_PWM_FREQ), - mock.call(ch3._gpio_pin, PUMP_PWM_FREQ) + mock.call().start(0), + mock.call(ch3._gpio_pin, PUMP_PWM_FREQ), + mock.call().start(0) ]) diff --git a/library/tox.ini b/library/tox.ini index 015a231..32c1734 100644 --- a/library/tox.ini +++ b/library/tox.ini @@ -1,11 +1,11 @@ [tox] -envlist = py{35,37},qa +envlist = py{37,38,39},qa skip_missing_interpreters = True [testenv] commands = python setup.py install - coverage run -m py.test -v -r wsx + coverage run -m pytest -v -r wsx coverage report deps = mock