Skip to content

Commit

Permalink
Added coverage results
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis-van-Gils committed Feb 27, 2023
1 parent f2f2eff commit 2cd3570
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 60 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
python -m pip install flake8 pytest coverage coveralls
python -m pip install ${{ matrix.qt-lib }}
python -m pip install -e .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
Expand All @@ -40,4 +40,22 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --cov src -s
coverage run ./tests/test_dvg_qdeviceio.py -vv --source=. -m
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }} ${{ matrix.qt-lib }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
:target: https://pypi.org/project/dvg-qdeviceio
.. image:: https://github.com/Dennis-van-Gils/python-dvg-qdeviceio/actions/workflows/python-package.yml/badge.svg
:target: https://github.com/Dennis-van-Gils/python-dvg-qdeviceio/actions/workflows/python-package.yml
.. image:: https://coveralls.io/repos/github/Dennis-van-Gils/python-dvg-qdeviceio/badge.svg
:target: https://coveralls.io/github/Dennis-van-Gils/python-dvg-qdeviceio
.. image:: https://readthedocs.org/projects/python-dvg-qdeviceio/badge/?version=latest
:target: https://python-dvg-qdeviceio.readthedocs.io/en/latest/?badge=latest
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
Expand Down
78 changes: 20 additions & 58 deletions tests/test_dvg_qdeviceio.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,61 +701,23 @@ def DAQ_function():


if __name__ == "__main__":
ALL = True
if ALL:
test_Worker_DAQ___INTERNAL_TIMER()
test_Worker_DAQ___INTERNAL_TIMER__start_dead()
test_Worker_DAQ___SINGLE_SHOT_WAKE_UP()
test_Worker_DAQ___SINGLE_SHOT_WAKE_UP__start_dead()
test_Worker_DAQ___CONTINUOUS()
test_Worker_DAQ___CONTINUOUS__start_dead()
test_Worker_jobs()
test_Worker_jobs__start_dead()
test_Worker_jobs__jobs_function()
test_attach_device_twice()
test_Worker_DAQ___no_device_attached()
test_Worker_jobs__no_device_attached()
test_Worker_DAQ___start_without_create()
test_Worker_jobs__start_without_create()
test_Worker_DAQ___quit_without_start()
test_Worker_jobs__quit_without_start()
test_Worker_DAQ___rate()
test_Worker_DAQ___lose_connection()
test_Worker_DAQ___INTERNAL_TIMER__subclassed()
test_Worker_DAQ___ILLEGAL_DAQ_FUNCTION()
else:
# test_Worker_DAQ___INTERNAL_TIMER()
# test_Worker_DAQ___INTERNAL_TIMER__start_dead()
# test_Worker_DAQ___SINGLE_SHOT_WAKE_UP()
# test_Worker_DAQ___SINGLE_SHOT_WAKE_UP__start_dead()

"""
import msvcrt
while True:
test_Worker_DAQ___CONTINUOUS()
if msvcrt.kbhit() and msvcrt.getch() == chr(27).encode():
break
"""

test_Worker_DAQ___CONTINUOUS()
# test_Worker_DAQ___CONTINUOUS__start_dead()

# test_Worker_DAQ___rate()
# test_Worker_DAQ___lose_connection()
# test_Worker_DAQ___no_device_attached()
# test_Worker_DAQ___start_without_create()

# test_Worker_jobs()
# test_Worker_jobs__start_dead()
# test_Worker_jobs__jobs_function()
# test_Worker_jobs__no_device_attached()
# test_Worker_jobs__start_without_create()

# test_Worker_DAQ___quit_without_start()
# test_Worker_jobs__quit_without_start()

# test_attach_device_twice()

# test_Worker_DAQ___INTERNAL_TIMER__subclassed()
# test_Worker_DAQ___lose_connection()
# test_Worker_DAQ___ILLEGAL_DAQ_FUNCTION()
test_Worker_DAQ___INTERNAL_TIMER()
test_Worker_DAQ___INTERNAL_TIMER__start_dead()
test_Worker_DAQ___SINGLE_SHOT_WAKE_UP()
test_Worker_DAQ___SINGLE_SHOT_WAKE_UP__start_dead()
test_Worker_DAQ___CONTINUOUS()
test_Worker_DAQ___CONTINUOUS__start_dead()
test_Worker_jobs()
test_Worker_jobs__start_dead()
test_Worker_jobs__jobs_function()
test_attach_device_twice()
test_Worker_DAQ___no_device_attached()
test_Worker_jobs__no_device_attached()
test_Worker_DAQ___start_without_create()
test_Worker_jobs__start_without_create()
test_Worker_DAQ___quit_without_start()
test_Worker_jobs__quit_without_start()
test_Worker_DAQ___rate()
test_Worker_DAQ___lose_connection()
test_Worker_DAQ___INTERNAL_TIMER__subclassed()
test_Worker_DAQ___ILLEGAL_DAQ_FUNCTION()

0 comments on commit 2cd3570

Please sign in to comment.