File tree Expand file tree Collapse file tree
python/quantum-pecos/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ def single_hadamard() -> bool:
100100
101101 print (f"Single module test - Modules: { module_count } , Functions: { function_names } " )
102102 assert module_count >= 1 , "Should have at least one module"
103- assert "single_hadamard" in function_names , "Should contain the main function"
103+ assert any ( fn . endswith ( "single_hadamard" ) for fn in function_names ) , "Should contain the main function"
104104
105105
106106def test_multiple_functions_compilation () -> None :
@@ -143,8 +143,10 @@ def single_qubit_test() -> bool:
143143 assert bell_modules >= 1 , "Bell pair should have at least one module"
144144 assert single_modules >= 1 , "Single qubit should have at least one module"
145145
146- assert "create_bell_pair" in bell_functions , "Bell HUGR should contain create_bell_pair"
147- assert "single_qubit_test" in single_functions , "Single HUGR should contain single_qubit_test"
146+ assert any (fn .endswith ("create_bell_pair" ) for fn in bell_functions ), "Bell HUGR should contain create_bell_pair"
147+ assert any (
148+ fn .endswith ("single_qubit_test" ) for fn in single_functions
149+ ), "Single HUGR should contain single_qubit_test"
148150
149151
150152def test_compiler_comparison_simple () -> None :
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ def my_quantum_circuit() -> bool:
179179 return measure (q )
180180
181181 ast = guppy_to_ast (my_quantum_circuit )
182- assert ast .name == "my_quantum_circuit"
182+ assert ast .name . endswith ( "my_quantum_circuit" )
183183
184184 def test_custom_allocator_name (self ) -> None :
185185 """Test custom allocator name."""
You can’t perform that action at this time.
0 commit comments