Пример #1
0
def test_deprecated_driver_keyword():
    st = station_from_config_str("""
instruments:
  mock:
    driver: qcodes.tests.instrument_mocks
    type: DummyChannelInstrument
    """)
    with assert_deprecated(
        deprecation_message(
            'use of the "driver"-keyword in the station configuration file',
            alternative='the "type"-keyword instead, prepending the driver value'
                        ' to it')):
        st.load_instrument('mock')
Пример #2
0
def test_deprecated_driver_keyword():
    st = station_from_config_str("""
instruments:
  mock:
    driver: qcodes.tests.instrument_mocks
    type: DummyChannelInstrument
    """)
    with warnings.catch_warnings(record=True) as w:
        st.load_instrument('mock')
    assert len(w) == 1
    assert issubclass(w[0].category, QCoDeSDeprecationWarning)
    assert w[0].message.args[0] == deprecation_message(
        'use of the "driver"-keyword in the station configuration file',
        alternative='the "type"-keyword instead, prepending the driver value'
        ' to it')
Пример #3
0
def test_deprecated_limits_keyword_as_string():
    st = station_from_config_str("""
instruments:
  mock:
    type: qcodes.tests.instrument_mocks.DummyInstrument
    init:
      gates: {"ch1"}
    parameters:
      ch1:
        limits: -10, 10
    """)
    with assert_deprecated(
            deprecation_message(
                'use of a comma separated string for the limits keyword',
                alternative='an array like "[lower_lim, upper_lim]"')):
        st.load_instrument('mock')
Пример #4
0
def test_deprecated_limits_keyword_as_string():
    st = station_from_config_str("""
instruments:
  mock:
    type: qcodes.tests.instrument_mocks.DummyInstrument
    init:
      gates: {"ch1"}
    parameters:
      ch1:
        limits: -10, 10
    """)
    with warnings.catch_warnings(record=True) as w:
        st.load_instrument('mock')
    assert len(w) == 1
    assert issubclass(w[0].category, QCoDeSDeprecationWarning)
    assert w[0].message.args[0] == deprecation_message(
        'use of a comma separated string for the limits keyword',
        alternative='an array like "[lower_lim, upper_lim]"')