Skip to content

Commit

Permalink
Add tests for cache's to_* methods that raise setpoint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
astafan8 committed Feb 23, 2021
1 parent 00f4bb3 commit 511949d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions qcodes/tests/dataset/test_dataset_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,11 +1375,19 @@ def test_write_data_to_text_file_name_exception(tmp_path):

def test_same_setpoint_warning_for_df_and_xarray(different_setpoint_dataset):

warning_mesage = ('Independent parameter setpoints are not equal. \
Check concatenated output carefully.')
warning_message = (
"Independent parameter setpoints are not equal. "
"Check concatenated output carefully."
)

with pytest.warns(UserWarning, match=warning_mesage):
with pytest.warns(UserWarning, match=warning_message):
different_setpoint_dataset.to_pandas_dataframe()

with pytest.warns(UserWarning, match=warning_mesage):
with pytest.warns(UserWarning, match=warning_message):
different_setpoint_dataset.to_xarray_dataset()

with pytest.warns(UserWarning, match=warning_message):
different_setpoint_dataset.cache.to_pandas_dataframe()

with pytest.warns(UserWarning, match=warning_message):
different_setpoint_dataset.cache.to_xarray_dataset()

0 comments on commit 511949d

Please sign in to comment.