diff --git a/tests/dataset/__init__.py b/tests/dataset/__init__.py index 7362041bca41..c42508231e72 100644 --- a/tests/dataset/__init__.py +++ b/tests/dataset/__init__.py @@ -1,3 +1,3 @@ import pytest -pytest.register_assert_rewrite('qcodes.tests.dataset.helper_functions') +pytest.register_assert_rewrite("tests.dataset.helper_functions") diff --git a/tests/dataset/dond/test_do0d.py b/tests/dataset/dond/test_do0d.py index bcc4ca22cebc..1c10da71abbb 100644 --- a/tests/dataset/dond/test_do0d.py +++ b/tests/dataset/dond/test_do0d.py @@ -14,7 +14,7 @@ Multi2DSetPointParam2Sizes, MultiSetPointParam, ) -from qcodes.tests.dataset.conftest import ArrayshapedParam +from tests.dataset.conftest import ArrayshapedParam @pytest.mark.usefixtures("plot_close", "experiment") diff --git a/tests/dataset/dond/test_do1d.py b/tests/dataset/dond/test_do1d.py index 3be863dd966b..28a02aad35f4 100644 --- a/tests/dataset/dond/test_do1d.py +++ b/tests/dataset/dond/test_do1d.py @@ -19,7 +19,7 @@ MultiSetPointParam, ) from qcodes.parameters import Parameter -from qcodes.tests.dataset.conftest import ArrayshapedParam +from tests.dataset.conftest import ArrayshapedParam @pytest.mark.usefixtures("plot_close", "experiment") diff --git a/tests/dataset/dond/test_doNd.py b/tests/dataset/dond/test_doNd.py index 16f685c6e919..ec073690b6fa 100644 --- a/tests/dataset/dond/test_doNd.py +++ b/tests/dataset/dond/test_doNd.py @@ -33,8 +33,8 @@ MultiSetPointParam, ) from qcodes.parameters import ManualParameter, Parameter, ParameterBase -from qcodes.tests.dataset.conftest import ArrayshapedParam from qcodes.validators import Ints +from tests.dataset.conftest import ArrayshapedParam class TrackingParameter(Parameter): diff --git a/tests/dataset/measurement/test_measurement_context_manager.py b/tests/dataset/measurement/test_measurement_context_manager.py index acc3a7e527fb..41e7cc376633 100644 --- a/tests/dataset/measurement/test_measurement_context_manager.py +++ b/tests/dataset/measurement/test_measurement_context_manager.py @@ -25,7 +25,7 @@ from qcodes.dataset.sqlite.connection import atomic_transaction from qcodes.parameters import ManualParameter, Parameter, expand_setpoints_helper from qcodes.station import Station -from qcodes.tests.common import retry_until_does_not_throw +from tests.common import retry_until_does_not_throw def test_log_messages(caplog: LogCaptureFixture, meas_with_registered_param) -> None: diff --git a/tests/dataset/test_database_creation_and_upgrading.py b/tests/dataset/test_database_creation_and_upgrading.py index 64b96ef33bf5..3b4e2cc0abd1 100644 --- a/tests/dataset/test_database_creation_and_upgrading.py +++ b/tests/dataset/test_database_creation_and_upgrading.py @@ -9,7 +9,7 @@ import qcodes as qc import qcodes.dataset.descriptions.versioning.serialization as serial -import qcodes.tests.dataset +import tests.dataset from qcodes.dataset import ( ConnectionPlus, connect, @@ -50,10 +50,10 @@ is_column_in_table, one, ) -from qcodes.tests.common import error_caused_by, skip_if_no_fixtures -from qcodes.tests.dataset.conftest import temporarily_copied_DB +from tests.common import error_caused_by, skip_if_no_fixtures +from tests.dataset.conftest import temporarily_copied_DB -fixturepath = os.sep.join(qcodes.tests.dataset.__file__.split(os.sep)[:-1]) +fixturepath = os.sep.join(tests.dataset.__file__.split(os.sep)[:-1]) fixturepath = os.path.join(fixturepath, 'fixtures') diff --git a/tests/dataset/test_database_extract_runs.py b/tests/dataset/test_database_extract_runs.py index 09c4cfe9e5a4..9b248b6167ce 100644 --- a/tests/dataset/test_database_extract_runs.py +++ b/tests/dataset/test_database_extract_runs.py @@ -12,7 +12,7 @@ from numpy.testing import assert_array_equal import qcodes as qc -import qcodes.tests.dataset +import tests.dataset from qcodes.dataset import do1d, do2d from qcodes.dataset.data_set import ( DataSet, @@ -35,7 +35,7 @@ from qcodes.dataset.sqlite.queries import get_experiments from qcodes.instrument_drivers.instrument_mocks import DummyInstrument from qcodes.station import Station -from qcodes.tests.common import error_caused_by, skip_if_no_fixtures +from tests.common import error_caused_by, skip_if_no_fixtures @contextmanager @@ -727,7 +727,7 @@ def test_old_versions_not_touched( _, new_v = get_db_version_and_newest_available_version(source_path) - fixturepath = os.sep.join(qcodes.tests.dataset.__file__.split(os.sep)[:-1]) + fixturepath = os.sep.join(tests.dataset.__file__.split(os.sep)[:-1]) fixturepath = os.path.join(fixturepath, 'fixtures', 'db_files', 'version2', 'some_runs.db') diff --git a/tests/dataset/test_dataset_basic.py b/tests/dataset/test_dataset_basic.py index c4bbb9c1bfd1..136263475a7d 100644 --- a/tests/dataset/test_dataset_basic.py +++ b/tests/dataset/test_dataset_basic.py @@ -29,10 +29,10 @@ from qcodes.dataset.sqlite.connection import atomic, path_to_dbfile from qcodes.dataset.sqlite.database import _convert_array, get_DB_location from qcodes.dataset.sqlite.queries import _rewrite_timestamps, _unicode_categories -from qcodes.tests.common import error_caused_by -from qcodes.tests.dataset.helper_functions import verify_data_dict -from qcodes.tests.dataset.test_links import generate_some_links from qcodes.utils.types import complex_types, numpy_complex, numpy_floats, numpy_ints +from tests.common import error_caused_by +from tests.dataset.helper_functions import verify_data_dict +from tests.dataset.test_links import generate_some_links n_experiments = 0 diff --git a/tests/dataset/test_dependencies.py b/tests/dataset/test_dependencies.py index ac1f775af5fa..c11268918930 100644 --- a/tests/dataset/test_dependencies.py +++ b/tests/dataset/test_dependencies.py @@ -12,7 +12,7 @@ from qcodes.dataset.descriptions.param_spec import ParamSpec, ParamSpecBase from qcodes.dataset.descriptions.versioning.converters import new_to_old, old_to_new from qcodes.dataset.descriptions.versioning.v0 import InterDependencies -from qcodes.tests.common import error_caused_by +from tests.common import error_caused_by def test_wrong_input_raises() -> None: diff --git a/tests/dataset/test_fix_functions.py b/tests/dataset/test_fix_functions.py index 7f18f5f9fef3..2b7cb3e273ea 100644 --- a/tests/dataset/test_fix_functions.py +++ b/tests/dataset/test_fix_functions.py @@ -5,7 +5,7 @@ import qcodes.dataset.descriptions.versioning.serialization as serial import qcodes.dataset.descriptions.versioning.v0 as v0 -import qcodes.tests.dataset +import tests.dataset from qcodes.dataset.database_fix_functions import ( fix_version_4a_run_description_bug, fix_wrong_run_descriptions, @@ -15,10 +15,10 @@ from qcodes.dataset.descriptions.versioning.converters import old_to_new from qcodes.dataset.sqlite.db_upgrades.version import get_user_version from qcodes.dataset.sqlite.queries import get_run_description -from qcodes.tests.common import skip_if_no_fixtures -from qcodes.tests.dataset.conftest import temporarily_copied_DB +from tests.common import skip_if_no_fixtures +from tests.dataset.conftest import temporarily_copied_DB -fixturepath = os.sep.join(qcodes.tests.dataset.__file__.split(os.sep)[:-1]) +fixturepath = os.sep.join(tests.dataset.__file__.split(os.sep)[:-1]) fixturepath = os.path.join(fixturepath, 'fixtures') diff --git a/tests/dataset/test_nested_measurements.py b/tests/dataset/test_nested_measurements.py index 083ae0f8d7e1..7ce1946c7806 100644 --- a/tests/dataset/test_nested_measurements.py +++ b/tests/dataset/test_nested_measurements.py @@ -10,7 +10,7 @@ from qcodes.dataset.descriptions.dependencies import InterDependencies_ from qcodes.dataset.descriptions.param_spec import ParamSpecBase from qcodes.dataset.sqlite.connection import atomic_transaction -from qcodes.tests.common import retry_until_does_not_throw +from tests.common import retry_until_does_not_throw VALUE = Union[str, float, list, np.ndarray, bool] diff --git a/tests/dataset/test_sqlite_base.py b/tests/dataset/test_sqlite_base.py index 24d4ab252186..b90e1e85c360 100644 --- a/tests/dataset/test_sqlite_base.py +++ b/tests/dataset/test_sqlite_base.py @@ -29,8 +29,8 @@ from qcodes.dataset.sqlite import query_helpers as mut_help from qcodes.dataset.sqlite.connection import atomic_transaction, path_to_dbfile from qcodes.dataset.sqlite.database import get_DB_location -from qcodes.tests.common import error_caused_by from qcodes.utils import QCoDeSDeprecationWarning +from tests.common import error_caused_by from .helper_functions import verify_data_dict diff --git a/tests/dataset/test_sqlite_connection.py b/tests/dataset/test_sqlite_connection.py index 1b418b4263da..425e6738ca67 100644 --- a/tests/dataset/test_sqlite_connection.py +++ b/tests/dataset/test_sqlite_connection.py @@ -10,7 +10,7 @@ make_connection_plus_from, ) from qcodes.dataset.sqlite.database import connect -from qcodes.tests.common import error_caused_by +from tests.common import error_caused_by def sqlite_conn_in_transaction(conn: sqlite3.Connection): diff --git a/tests/dataset/test_subscribing.py b/tests/dataset/test_subscribing.py index 3e9482effd08..05d29ed5dae8 100644 --- a/tests/dataset/test_subscribing.py +++ b/tests/dataset/test_subscribing.py @@ -10,7 +10,7 @@ from qcodes.dataset.descriptions.dependencies import InterDependencies_ from qcodes.dataset.descriptions.param_spec import ParamSpecBase from qcodes.dataset.sqlite.connection import atomic_transaction -from qcodes.tests.common import retry_until_does_not_throw +from tests.common import retry_until_does_not_throw log = logging.getLogger(__name__) @@ -67,7 +67,7 @@ def _make_working_subscriber_config(tmp_path): "subscription":{ "subscribers":{ "test_subscriber":{ - "factory": "qcodes.tests.dataset.test_subscribing.MockSubscriber", + "factory": "tests.dataset.test_subscribing.MockSubscriber", "factory_kwargs":{ "lg": false }, @@ -96,7 +96,7 @@ def _make_broken_subscriber_config(tmp_path): "subscription":{ "subscribers":{ "test_subscriber_wrong":{ - "factory": "qcodes.tests.dataset.test_subscribing.MockSubscriber", + "factory": "tests.dataset.test_subscribing.MockSubscriber", "factory_kwargs":{ "lg": false }, diff --git a/tests/drivers/test_Agilent_E8257D.py b/tests/drivers/test_Agilent_E8257D.py index dd2ceca60233..d50b71dd477c 100644 --- a/tests/drivers/test_Agilent_E8257D.py +++ b/tests/drivers/test_Agilent_E8257D.py @@ -1,5 +1,5 @@ from qcodes.instrument_drivers.agilent import AgilentE8257D -from qcodes.tests.driver_test_case import DriverTestCase +from tests.driver_test_case import DriverTestCase class TestAgilentE8257D(DriverTestCase): diff --git a/tests/drivers/test_lakeshore_335.py b/tests/drivers/test_lakeshore_335.py index 8ddce6edb9f3..f06c9b9e3362 100644 --- a/tests/drivers/test_lakeshore_335.py +++ b/tests/drivers/test_lakeshore_335.py @@ -2,16 +2,15 @@ import time from qcodes.instrument import InstrumentBase -from qcodes.instrument_drivers.Lakeshore import LakeshoreModel335 - -from .test_lakeshore import ( +from qcodes.instrument_drivers.instrument_mocks import instrument_fixture +from qcodes.instrument_drivers.instrument_mocks.lakeshore import ( DictClass, MockVisaInstrument, command, - instrument_fixture, query, split_args, ) +from qcodes.instrument_drivers.Lakeshore import LakeshoreModel335 log = logging.getLogger(__name__) diff --git a/tests/drivers/test_lakeshore_336.py b/tests/drivers/test_lakeshore_336.py index 1a2f0c8e5a11..20ceb17d827d 100644 --- a/tests/drivers/test_lakeshore_336.py +++ b/tests/drivers/test_lakeshore_336.py @@ -2,16 +2,15 @@ import time from qcodes.instrument import InstrumentBase -from qcodes.instrument_drivers.Lakeshore import LakeshoreModel336 - -from .test_lakeshore import ( +from qcodes.instrument_drivers.instrument_mocks import instrument_fixture +from qcodes.instrument_drivers.instrument_mocks.lakeshore import ( DictClass, MockVisaInstrument, command, - instrument_fixture, query, split_args, ) +from qcodes.instrument_drivers.Lakeshore import LakeshoreModel336 log = logging.getLogger(__name__) diff --git a/tests/drivers/test_lakeshore_336_legacy.py b/tests/drivers/test_lakeshore_336_legacy.py index 5bfc06423cbc..6b9236784409 100644 --- a/tests/drivers/test_lakeshore_336_legacy.py +++ b/tests/drivers/test_lakeshore_336_legacy.py @@ -2,16 +2,15 @@ import time from qcodes.instrument import InstrumentBase -from qcodes.instrument_drivers.Lakeshore.Model_336 import Model_336 - -from .test_lakeshore import ( +from qcodes.instrument_drivers.instrument_mocks import instrument_fixture +from qcodes.instrument_drivers.instrument_mocks.lakeshore import ( DictClass, MockVisaInstrument, command, - instrument_fixture, query, split_args, ) +from qcodes.instrument_drivers.Lakeshore.Model_336 import Model_336 log = logging.getLogger(__name__) diff --git a/tests/drivers/test_tektronix_AWG70000A.py b/tests/drivers/test_tektronix_AWG70000A.py index 44f5648b68ba..0894e41ee153 100644 --- a/tests/drivers/test_tektronix_AWG70000A.py +++ b/tests/drivers/test_tektronix_AWG70000A.py @@ -12,7 +12,7 @@ from lxml import etree from pytest import LogCaptureFixture -import qcodes.tests.drivers.auxiliary_files as auxfiles +import tests.drivers.auxiliary_files as auxfiles from qcodes.instrument_drivers.tektronix.AWG70000A import AWG70000A from qcodes.instrument_drivers.tektronix.AWG70002A import AWG70002A diff --git a/tests/drivers/test_weinchel.py b/tests/drivers/test_weinchel.py index 67b1bc8623eb..9c868f35fe99 100644 --- a/tests/drivers/test_weinchel.py +++ b/tests/drivers/test_weinchel.py @@ -1,5 +1,5 @@ from qcodes.instrument_drivers.weinschel import Weinschel8320 -from qcodes.tests.driver_test_case import DriverTestCase +from tests.driver_test_case import DriverTestCase class TestWeinschel8320(DriverTestCase): diff --git a/tests/helpers/test_compare_dictionaries.py b/tests/helpers/test_compare_dictionaries.py index 869f89708be1..fe637bf65083 100644 --- a/tests/helpers/test_compare_dictionaries.py +++ b/tests/helpers/test_compare_dictionaries.py @@ -1,7 +1,7 @@ import numpy as np import pytest -from qcodes.tests.common import compare_dictionaries +from tests.common import compare_dictionaries def test_same() -> None: diff --git a/tests/test_instrument.py b/tests/test_instrument.py index b3ef4e5fd82e..60f6b2b1c057 100644 --- a/tests/test_instrument.py +++ b/tests/test_instrument.py @@ -344,7 +344,7 @@ class GammyInstrument(Instrument): error_msg = ( "Instrument instr is but " - "" ".GammyInstrument'> was requested" ) diff --git a/tests/test_station.py b/tests/test_station.py index 2a94ac07935b..7e7aacb1cfa4 100644 --- a/tests/test_station.py +++ b/tests/test_station.py @@ -587,8 +587,9 @@ def test_able_to_load_instrument_with_name_argument_not_being_the_first() -> Non """ instruments: name_goes_second: - type: qcodes.tests.test_station.InstrumentWithNameAsNotFirstArgument - """) + type: tests.test_station.InstrumentWithNameAsNotFirstArgument + """ + ) instr = st.load_instrument('name_goes_second', first_arg=42) assert isinstance(instr, InstrumentWithNameAsNotFirstArgument)