Skip to content

Commit

Permalink
tests: import instrument from top level
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Jun 17, 2022
1 parent 9d2613c commit b45dccf
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 22 deletions.
4 changes: 2 additions & 2 deletions qcodes/tests/drivers/test_ami430.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
from hypothesis.strategies import floats, tuples

import qcodes.instrument.sims as sims
from qcodes.instrument.base import Instrument
from qcodes.instrument import Instrument
from qcodes.instrument.ip_to_visa import AMI430_VISA
from qcodes.instrument_drivers.american_magnetics.AMI430 import (
AMI430,
AMI430_3D,
AMI430Warning,
)
from qcodes.math_utils.field_vector import FieldVector
from qcodes.math_utils import FieldVector
from qcodes.utils.types import (
numpy_concrete_floats,
numpy_concrete_ints,
Expand Down
4 changes: 2 additions & 2 deletions qcodes/tests/drivers/test_ami430_visa.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
from hypothesis.strategies import floats, tuples

import qcodes.instrument.sims as sims
from qcodes.instrument.base import Instrument
from qcodes.instrument import Instrument
from qcodes.instrument_drivers.american_magnetics.AMI430_visa import (
AMI430,
AMI430_3D,
AMI430Warning,
)
from qcodes.math_utils.field_vector import FieldVector
from qcodes.math_utils import FieldVector
from qcodes.utils.types import (
numpy_concrete_floats,
numpy_concrete_ints,
Expand Down
2 changes: 1 addition & 1 deletion qcodes/tests/drivers/test_lakeshore.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest

import qcodes.instrument.sims as sims
from qcodes.instrument.base import InstrumentBase
from qcodes.instrument import InstrumentBase
from qcodes.instrument_drivers.Lakeshore.lakeshore_base import BaseSensorChannel
from qcodes.instrument_drivers.Lakeshore.Model_372 import Model_372
from qcodes.logger.instrument_logger import get_instrument_logger
Expand Down
15 changes: 10 additions & 5 deletions qcodes/tests/drivers/test_lakeshore_336.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
import time
from typing import Dict

from qcodes.instrument.base import InstrumentBase
from qcodes.instrument_drivers.Lakeshore.Model_336 import Model_336
import qcodes.instrument.sims as sims
from qcodes.instrument import InstrumentBase
from qcodes.instrument_drivers.Lakeshore.Model_336 import Model_336

from .test_lakeshore import MockVisaInstrument, split_args, DictClass, \
query, command, instrument_fixture

from .test_lakeshore import (
DictClass,
MockVisaInstrument,
command,
instrument_fixture,
query,
split_args,
)

log = logging.getLogger(__name__)

Expand Down
3 changes: 1 addition & 2 deletions qcodes/tests/instrument_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import numpy as np

from qcodes.instrument.base import Instrument, InstrumentBase
from qcodes.instrument.channel import ChannelList, InstrumentChannel
from qcodes.instrument import ChannelList, Instrument, InstrumentBase, InstrumentChannel
from qcodes.parameters import (
ArrayParameter,
MultiParameter,
Expand Down
2 changes: 1 addition & 1 deletion qcodes/tests/parameter/test_parameter_basics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest

import qcodes.utils.validators as vals
from qcodes.instrument.function import Function
from qcodes.instrument import Function
from qcodes.parameters import Parameter, ParameterBase

from .conftest import (
Expand Down
3 changes: 1 addition & 2 deletions qcodes/tests/sphinx_extension/test_parse_parameter_attr.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pytest
from sphinx.util.inspect import safe_getattr

from qcodes.instrument.base import InstrumentBase
from qcodes.instrument.visa import VisaInstrument
from qcodes.instrument import InstrumentBase, VisaInstrument
from qcodes.sphinx_extensions.parse_parameter_attr import (
ParameterProxy,
qcodes_parameter_attr_getter,
Expand Down
3 changes: 1 addition & 2 deletions qcodes/tests/test_abstract_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import pytest

from qcodes import ChannelList, Instrument, InstrumentChannel
from qcodes.instrument.base import InstrumentBase
from qcodes.instrument import ChannelList, Instrument, InstrumentBase, InstrumentChannel


class ExampleBaseVoltageSource(Instrument):
Expand Down
3 changes: 1 addition & 2 deletions qcodes/tests/test_autoloadable_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

import pytest

from qcodes import Instrument
from qcodes.instrument import Instrument, InstrumentChannel
from qcodes.instrument.channel import (
AutoLoadableChannelList,
AutoLoadableInstrumentChannel,
InstrumentChannel,
)


Expand Down
10 changes: 7 additions & 3 deletions qcodes/tests/test_instrument.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Test suite for instument.base.*
Test suite for Instrument and InstrumentBase
"""
import contextlib
import io
Expand All @@ -8,8 +8,12 @@

import pytest

from qcodes.instrument.base import Instrument, InstrumentBase, find_or_create_instrument
from qcodes.instrument.function import Function
from qcodes.instrument import (
Function,
Instrument,
InstrumentBase,
find_or_create_instrument,
)
from qcodes.parameters import Parameter

from .instrument_mocks import (
Expand Down

0 comments on commit b45dccf

Please sign in to comment.