Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Continuous Integration
on:
schedule:
- cron: '0 0 * * 2'
push:
branches:
- main
pull_request:
branches:
- main
paths:
- .github/workflows/ci.yml
- "exopy/**"
- "tests/**"
- setup.py

jobs:
tests:
name: Unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel pyqt5
- name: Install project
run: |
python setup.py develop
- name: Install pytest
run: |
python -m pip install pytest pytest-cov pytest-qt pytest-timeout
python -m pip install https://github.com/MatthieuDartiailh/enaml_coverage_plugin/tarball/master
- name: Run tests (Windows)
if: matrix.os != 'ubuntu-latest'
run: python -X dev -m pytest tests --cov enaml --cov-report xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: matrix.os != 'windows-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions conda/bld.bat

This file was deleted.

5 changes: 0 additions & 5 deletions conda/build.sh

This file was deleted.

50 changes: 0 additions & 50 deletions conda/meta.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions continuous-integration/anaconda-push.py

This file was deleted.

8 changes: 0 additions & 8 deletions continuous-integration/deploy.sh

This file was deleted.

4 changes: 2 additions & 2 deletions docs/source/dev_guide/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ after the tests.

To avoid duplicating a lot of code Pytest provides fixture functions. A fixture
function is imply a function decorated with '@pytest.fixture' (or
'@pytest.yield_fixture') which, when passed as argument of a test function,
'@pytest.fixture') which, when passed as argument of a test function,
will be called automatically by pytest. Standard fixture simply gives access to
a value, yield_fixture allow to cleanup after the test execution. Note that a
fixture can rely on another fixture.
Expand All @@ -113,7 +113,7 @@ fixture can rely on another fixture.
def tool():
return 1

@pytest.yield_fixture
@pytest.fixture
def clean_tool(tool):
yield tool # This will pass 1 to the test function
del tool # This is executed after the test function (no matter the errors)
Expand Down
3 changes: 2 additions & 1 deletion exopy/app/errors/manifest.enaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"""
import logging
from pprint import pformat
from collections import defaultdict, Mapping
from collections import defaultdict
from collections.abc import Mapping

from enaml.workbench.api import PluginManifest, ExtensionPoint, Extension
from enaml.workbench.core.api import Command
Expand Down
2 changes: 1 addition & 1 deletion exopy/app/packages/manifest.enaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ unregistered first).

"""
import logging
from collections import Mapping
from collections.abc import Mapping
from pprint import pformat

from enaml.workbench.api import PluginManifest, Extension
Expand Down
2 changes: 1 addition & 1 deletion exopy/instruments/manifest.enaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

"""
import logging
from collections import Mapping
from collections.abc import Mapping
from ast import literal_eval

import enaml
Expand Down
2 changes: 1 addition & 1 deletion exopy/measurement/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""Specialised container used to store measurements.

"""
from collections import Iterable
from collections.abc import Iterable

from atom.api import Atom, List, Signal

Expand Down
3 changes: 2 additions & 1 deletion exopy/measurement/editors/execution_editor/editor.enaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

"""
from operator import attrgetter
from collections import Iterable, OrderedDict
from collections import OrderedDict
from collections.abc import Iterable
from time import sleep

from atom.api import Value, Typed
Expand Down
3 changes: 2 additions & 1 deletion exopy/measurement/editors/execution_editor/editor_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"""Model for the execution editor keeping track of the declared pools.

"""
from collections import Counter, Iterable
from collections import Counter
from collections.abc import Iterable

from atom.api import Atom, Value, Typed, List

Expand Down
2 changes: 1 addition & 1 deletion exopy/measurement/manifest.enaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

"""
import logging
from collections import Mapping
from collections.abc import Mapping
from pprint import pformat

import enaml
Expand Down
2 changes: 1 addition & 1 deletion exopy/measurement/workspace/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def _insert_new_edition_panels(self, measurements, update=True,
if panels is None:
template = 'meas_%d'
items = self.dock_area.dock_items()
test = re.compile('meas\_([0-9]+)$')
test = re.compile(r'meas\_([0-9]+)$')
measurement_items = [i for i in items if test.match(i.name)]

ops = []
Expand Down
2 changes: 1 addition & 1 deletion exopy/tasks/tasks/base_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import logging
import threading
from multiprocessing.synchronize import Event
from collections import Iterable
from collections.abc import Iterable
from inspect import cleandoc
from textwrap import fill
from copy import deepcopy
Expand Down
2 changes: 1 addition & 1 deletion exopy/tasks/tasks/logic/loop_iterable_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import numpy as np

from atom.api import Str
from collections import Iterable
from collections.abc import Iterable

from ..task_interface import TaskInterface
from ..validators import Feval
Expand Down
2 changes: 1 addition & 1 deletion exopy/tasks/tasks/logic/loop_linspace_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ def perform(self):
raw_values = np.linspace(start, stop, num)
iterable = np.fromiter((round(value, digit)
for value in raw_values),
np.float, len(raw_values))
np.float64, len(raw_values))
task.write_in_database('loop_values', np.array(iterable))
task.perform_loop(iterable)
10 changes: 5 additions & 5 deletions exopy/testing/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def dialog_sleep():
return DIALOG_SLEEP


@pytest.yield_fixture(scope='session', autouse=True)
@pytest.fixture(scope='session', autouse=True)
def sys_path():
"""Detect installation path of exopy.

Expand Down Expand Up @@ -106,7 +106,7 @@ def watchdog_on_travis():
watchdog.observers.Observer = PollingObserver


@pytest.yield_fixture(scope='session')
@pytest.fixture(scope='session')
def app():
"""Make sure a QtApplication is active.

Expand All @@ -120,7 +120,7 @@ def app():
yield app


@pytest.yield_fixture
@pytest.fixture
def exopy_qtbot(app, qtbot):
"""Set the enaml application on the bot and add automatic windows cleanup.

Expand All @@ -130,7 +130,7 @@ def exopy_qtbot(app, qtbot):
yield qtbot


@pytest.yield_fixture
@pytest.fixture
def app_dir(tmpdir):
"""Fixture setting the app_directory.ini file for each test.

Expand All @@ -147,7 +147,7 @@ def app_dir(tmpdir):
remove(app_pref)


@pytest.yield_fixture
@pytest.fixture
def logger(caplog):
"""Fixture returning a logger for testing and cleaning handlers afterwards.

Expand Down
Loading