Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Compare sorted tags in test_save_all#214

Merged
rathishcholarajan merged 1 commit into
Qiskit:mainfrom
mriedem:210-compare-sorted-tags
Nov 23, 2021
Merged

Compare sorted tags in test_save_all#214
rathishcholarajan merged 1 commit into
Qiskit:mainfrom
mriedem:210-compare-sorted-tags

Conversation

@mriedem
Copy link
Copy Markdown
Contributor

@mriedem mriedem commented Nov 23, 2021

Summary

qiskit-experiments does not maintain order on experiment
tags since [1] so we need to compare experiment tags in
the test_save_all test with a predictable sort order.

[1] qiskit-community/qiskit-experiments#522

Details and comments

Closes #210

qiskit-experiments does not maintain order on experiment
tags since [1] so we need to compare experiment tags in
the `test_save_all` test with a predictable sort order.

[1] qiskit-community/qiskit-experiments#522

Closes Qiskit#210
@mriedem
Copy link
Copy Markdown
Contributor Author

mriedem commented Nov 23, 2021

Before this change:

$ LOG_LEVEL=INFO python -m unittest -v test.ibm.experiment.test_experiment_data_integration.TestExperimentDataIntegration.test_save_all
test_save_all (test.ibm.experiment.test_experiment_data_integration.TestExperimentDataIntegration)
Test saving all. ... You can view the experiment online at https://quantum-computing.ibm.com/experiments/772d71d1-5482-4b37-8ed7-492a5c46f144
You can view the experiment online at https://quantum-computing.ibm.com/experiments/772d71d1-5482-4b37-8ed7-492a5c46f144
FAIL

======================================================================
FAIL: test_save_all (test.ibm.experiment.test_experiment_data_integration.TestExperimentDataIntegration)
Test saving all.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/osboxes/ibmq/qiskit-ibm/test/ibm/experiment/test_experiment_data_integration.py", line 313, in test_save_all
    self.assertEqual(["foo", "bar"], rexp.tags)
AssertionError: Lists differ: ['foo', 'bar'] != ['bar', 'foo']

First differing element 0:
'foo'
'bar'

- ['foo', 'bar']
+ ['bar', 'foo']

----------------------------------------------------------------------
Ran 1 test in 9.308s

FAILED (failures=1)

After this change:

$ LOG_LEVEL=INFO python -m unittest -v test.ibm.experiment.test_experiment_data_integration.TestExperimentDataIntegration.test_save_all
test_save_all (test.ibm.experiment.test_experiment_data_integration.TestExperimentDataIntegration)
Test saving all. ... You can view the experiment online at https://quantum-computing.ibm.com/experiments/3a862d54-4ecf-4e63-aa9a-dd07980e1d9a
You can view the experiment online at https://quantum-computing.ibm.com/experiments/3a862d54-4ecf-4e63-aa9a-dd07980e1d9a
You can view the experiment online at https://quantum-computing.ibm.com/experiments/3a862d54-4ecf-4e63-aa9a-dd07980e1d9a
ok

----------------------------------------------------------------------
Ran 1 test in 10.437s

OK

Copy link
Copy Markdown
Member

@rathishcholarajan rathishcholarajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@rathishcholarajan rathishcholarajan merged commit be7056e into Qiskit:main Nov 23, 2021
@mriedem mriedem deleted the 210-compare-sorted-tags branch November 23, 2021 19:00
mriedem added a commit to mriedem/qiskit-experiments that referenced this pull request Mar 3, 2022
qiskit-experiments does not maintain order on experiment
tags since qiskit-community#522 so we need to compare experiment tags in
the `test_save_all` test with a predictable sort order.

This was originally fixed in qiskit-ibm-provider:

Qiskit/qiskit-ibm-provider#214

Closes qiskit-community#708
wshanks added a commit to qiskit-community/qiskit-experiments that referenced this pull request Mar 4, 2022
qiskit-experiments does not maintain order on experiment
tags since #522 so we need to compare experiment tags in
the `test_save_all` test with a predictable sort order.

This was originally fixed in qiskit-ibm-provider:

Qiskit/qiskit-ibm-provider#214

Closes #708

Co-authored-by: Will Shanks <willshanks@us.ibm.com>
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
qiskit-experiments does not maintain order on experiment
tags since qiskit-community#522 so we need to compare experiment tags in
the `test_save_all` test with a predictable sort order.

This was originally fixed in qiskit-ibm-provider:

Qiskit/qiskit-ibm-provider#214

Closes qiskit-community#708

Co-authored-by: Will Shanks <willshanks@us.ibm.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestExperimentDataIntegration.test_save_all fails with "AssertionError: Lists differ: ['foo', 'bar'] != ['bar', 'foo']"

2 participants