Skip to content

Commit

Permalink
move DumyPar to a shared location
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Jun 10, 2020
1 parent 5d7cd07 commit 439bb7c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
16 changes: 16 additions & 0 deletions qcodes/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from time import sleep
import cProfile

from qcodes.utils.metadata import Metadatable

if TYPE_CHECKING:
from _pytest._code.code import ExceptionInfo
Expand Down Expand Up @@ -118,3 +119,18 @@ def error_caused_by(excinfo: 'ExceptionInfo', cause: str) -> bool:
return cause in str(root_traceback)


class DumyPar(Metadatable):

"""Docstring for DumyPar. """

def __init__(self, name):
super().__init__()
self.name = name
self.full_name = name

def __str__(self):
return self.full_name

def set(self, value):
value = value * 2
return value
20 changes: 2 additions & 18 deletions qcodes/tests/parameter/test_combined_par.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,9 @@
import numpy as np

from qcodes.instrument.parameter import combine
from qcodes.utils.metadata import Metadatable
from qcodes.utils.helpers import full_class


class DumyPar(Metadatable):

"""Docstring for DumyPar. """

def __init__(self, name):
super().__init__()
self.name = name
self.full_name = name

def __str__(self):
return self.full_name

def set(self, value):
value = value * 2
return value
from qcodes.utils.helpers import full_class
from ..common import DumyPar


class TestMultiPar(unittest.TestCase):
Expand Down
1 change: 1 addition & 0 deletions qcodes/tests/parameter/test_delegate_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Disable warning that is created by using fixtures
# pylint: disable=redefined-outer-name


@pytest.fixture()
def numeric_val():
yield 1
Expand Down
2 changes: 1 addition & 1 deletion qcodes/tests/test_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
from qcodes.monitor.monitor import Monitor
from qcodes.tests.instrument_mocks import (
DummyInstrument)
from qcodes.tests.test_combined_par import DumyPar
from qcodes.tests.test_config import default_config
from qcodes.utils.helpers import NumpyJSONEncoder
from qcodes.utils.helpers import YAML
from .common import DumyPar


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 439bb7c

Please sign in to comment.