forked from TeamGraphix/graphix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely migrate to pytest (TeamGraphix#134)
* 🚨 Remove self.assertRaises * 🚨 Remove self.assertTrue * 🎨 Resolve redundant assert * 🚨 Remove self.assertEqual * 🐛 Change class name Make pytest aware of them * 🚧 Partially remove unittest * 🎨 Update test_linalg.py * 🎨 Update test_tnsim.py * ➕ Add pytest-mock * 🎨 Use pytest-mock * 🎨 Update test_gflow.py * ♻️ Refactor rndom_circuit.py Now it's stateless * ✅ Add rng fixture * 🐛 Fix random_circuit.py * 🎨 Resolve rng global state problem * 🚧 Update test_pattern.py Not passing tests * ♻️ Refactor test_clifford.py * ♻️ Refactor test_density_matrix.py * ♻️ Refactor test_generator.py * ♻️ Refactor test_extraction.py * ♻️ Refactor test_gflow.py * ♻️ Refactor test_graphsim.py * ♻️ Refactor test_kraus.py * 🐛 Add __future__ * 🚨 Move to TYPE_CHECKING block * ♻️ Refactor test_linalg.py * ♻️ Refactor test_noisy_density_matrix.py * ♻️ Refactor test_pattern.py * ♻️ Refactor test_pauli.py * ♻️ Refactor test_random_utilities.py * ♻️ Refactor test_runner.py * ♻️ Refactor test_statevec_backend.py * ♻️ Refactor test_tnsim.py * ♻️ Refactor test_transpiler.py * 💡 Resolve too long line * ➖ Remove parameterized * ♻️ Remove np.testing.assert_equal * ♻️ Remove np.testing.assert_almost_equal * ♻️ Remove np.testing.assert_allclose * 🚨 Apply isort * 💩 Skip broken tests See issue TeamGraphix#130 * 🐛 Add version switcher * 🚨 Apply isort * 🩹 Specify RNG type * 🎨 Collapse for * ✨ Add fx_bg * 🎨 Collapse random repeat * 🎨 Drop unused imports
- Loading branch information
1 parent
1a7c64a
commit e9ccc15
Showing
19 changed files
with
1,972 additions
and
1,833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ isort==5.13.2 | |
|
||
# Tests | ||
pytest | ||
parameterized | ||
pytest-mock | ||
tox | ||
|
||
# Optional dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
from numpy.random import PCG64, Generator | ||
|
||
SEED = 42 | ||
|
||
|
||
@pytest.fixture() | ||
def fx_rng() -> Generator: | ||
return Generator(PCG64(SEED)) | ||
|
||
|
||
@pytest.fixture() | ||
def fx_bg() -> PCG64: | ||
return PCG64(SEED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.