Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
1ucian0 committed Feb 13, 2024
1 parent 42501a2 commit dddca99
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/python/visualization/test_circuit_drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ def test_default_output(self):
out = visualization.circuit_drawer(circuit)
self.assertIsInstance(out, text.TextDrawing)

@unittest.skipUnless(optionals.HAS_MATPLOTLIB, "Skipped because matplotlib is not available")
def test_mpl_config_with_path(self):
with patch(
"qiskit.user_config.get_config",
return_value={
"circuit_drawer": "mpl",
"circuit_mpl_style": "quantum-light",
"circuit_mpl_style_path": ["~/.qiskit"],
},
):
circuit = QuantumCircuit(1)
circuit.h(0)
out = visualization.circuit_drawer(circuit)
self.assertIsInstance(out, figure.Figure)

@unittest.skipUnless(optionals.HAS_MATPLOTLIB, "Skipped because matplotlib is not available")
def test_user_config_default_output(self):
with patch("qiskit.user_config.get_config", return_value={"circuit_drawer": "mpl"}):
Expand Down

0 comments on commit dddca99

Please sign in to comment.