Skip to content

Commit

Permalink
test: fixing py tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Nov 16, 2023
1 parent 6efc7ec commit c6e3343
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/prepare_environment.sh

This file was deleted.

21 changes: 11 additions & 10 deletions .github/workflows/python2-3-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name != 'push'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v2
with:
python-version: '3.9'
Expand All @@ -18,6 +18,7 @@ jobs:

build:
runs-on: ubuntu-latest
if: github.event_name != 'push'
strategy:
fail-fast: False
matrix:
Expand All @@ -27,20 +28,20 @@ jobs:
- 3.9

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2

- uses: actions/checkout@v2
- name: Prepare environment
run: .github/workflows/prepare_environment.sh ${{ matrix.python_version }}
- uses: actions/checkout@v4
- name: prepare environment
run: |
conda config --set add_pip_as_python_dependency false
conda create -c conda-forge -n db12 python=${{ matrix.python_version }}
- name: Run pylint
run: |
. "${CONDA}/bin/activate" test-env
eval "$(conda shell.bash hook)" && conda activate db12
conda install -c conda-forge pylint pytest mock
pylint -E src/db12/ tests/
- name: Run pytest
run: |
. "${CONDA}/bin/activate" test-env
eval "$(conda shell.bash hook)" && conda activate db12
conda install -c conda-forge pylint pytest mock
pytest tests
4 changes: 0 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ name: db12
dependencies:
- python =3.9
- future
- mock
- pre-commit
- pylint
- pytest
- pytest-mock
2 changes: 1 addition & 1 deletion src/db12/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def single_dirac_benchmark(iterations_num=1, measured_copies=None, correction=Tr

it_1 += 1

cput = sum(end[:4]) - sum(start[:4])
cput = sum(end[:4]) - sum(start[:4]) # pylint: disable=used-before-assignment
wall = end[4] - start[4]

if not cput:
Expand Down

0 comments on commit c6e3343

Please sign in to comment.