CI: Fix CI workflow.

This commit is contained in:
Phil Howard
2023-01-19 16:00:26 +00:00
parent a218cea193
commit a20a054c0f
3 changed files with 11 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python: [3.5, 3.6, 3.7, 3.8] python: [3.7, 3.9]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -33,5 +33,5 @@ jobs:
run: | run: |
python -m pip install coveralls python -m pip install coveralls
coveralls --service=github coveralls --service=github
if: ${{ matrix.python == '3.8' }} if: ${{ matrix.python == '3.9' }}

View File

@@ -8,7 +8,7 @@ def test_moisture_setup(GPIO, smbus):
ch2 = Moisture(channel=2) ch2 = Moisture(channel=2)
ch3 = Moisture(channel=3) ch3 = Moisture(channel=3)
assert GPIO.setup.has_calls([ GPIO.setup.assert_has_calls([
mock.call(ch1._gpio_pin, GPIO.IN), mock.call(ch1._gpio_pin, GPIO.IN),
mock.call(ch2._gpio_pin, GPIO.IN), mock.call(ch2._gpio_pin, GPIO.IN),
mock.call(ch3._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) ch2 = Pump(channel=2)
ch3 = Pump(channel=3) 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(ch1._gpio_pin, GPIO.OUT, initial=GPIO.LOW),
mock.call(ch2._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) 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(ch1._gpio_pin, PUMP_PWM_FREQ),
mock.call().start(0),
mock.call(ch2._gpio_pin, PUMP_PWM_FREQ), 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)
]) ])

View File

@@ -1,11 +1,11 @@
[tox] [tox]
envlist = py{35,37},qa envlist = py{37,38,39},qa
skip_missing_interpreters = True skip_missing_interpreters = True
[testenv] [testenv]
commands = commands =
python setup.py install python setup.py install
coverage run -m py.test -v -r wsx coverage run -m pytest -v -r wsx
coverage report coverage report
deps = deps =
mock mock