Skip to content

Commit 3cad396

Browse files
committed
Fix and re-enable test_merges
1 parent b92c2fc commit 3cad396

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ install-optional: install
3030
tests:
3131
@${PYTHON} -m pytest -v ${TEST_DIR}/quick
3232

33+
tests_slow:
34+
@${PYTHON} -m pytest -v ${TEST_DIR}/slow
35+
3336
tests_all:
3437
@${PYTHON} -m pytest -v --capture=tee-sys ${TEST_DIR}
3538

tests/slow/merges/test_merges.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import sys
2+
from pathlib import Path
3+
24
import pytest
35
import os
46
import unittest
@@ -148,8 +150,8 @@ def remote_receive_one_qubit(self, virtualNum, cnot_direction=0):
148150
return bool(correct)
149151

150152

151-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
152-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
153+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
154+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
153155
class TestMerge(unittest.TestCase):
154156
@classmethod
155157
def setUpClass(cls):
@@ -165,7 +167,7 @@ def setUpClass(cls):
165167
network_config_file = os.path.join(path_to_here, "configs", "network.json")
166168
network_config.read_from_file(network_config_file)
167169
nodes = ["Alice", "Bob", "Charlie"]
168-
cls.network = Network(nodes=nodes)
170+
cls.network = Network(nodes=nodes, network_config_file=Path(network_config_file))
169171
cls.network.start()
170172

171173
@classmethod
@@ -228,8 +230,8 @@ def run_test(self, nodes_in_class_network: List[str]):
228230
self.assertTrue(all(results))
229231

230232

231-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
232-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
233+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
234+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
233235
class TestBothLocal(TestMerge):
234236
@classmethod
235237
def setUpClass(cls):
@@ -289,8 +291,8 @@ def test(self):
289291
self.run_test([])
290292

291293

292-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
293-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
294+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
295+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
294296
class TestBothLocalNotSameReg(TestBothLocal):
295297
@classmethod
296298
@inlineCallbacks
@@ -341,8 +343,8 @@ def alice(cls, qReg, virtRoot, myName, classicalNet, send_end):
341343
reactor.stop()
342344

343345

344-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
345-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
346+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
347+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
346348
class TestBothRemote(TestMerge):
347349
@classmethod
348350
def setUpClass(cls):
@@ -433,8 +435,8 @@ def test(self):
433435
self.run_test(["Alice", "Bob", "Charlie"])
434436

435437

436-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
437-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
438+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
439+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
438440
class TestBothRemoteSameNodeDiffReg(TestMerge):
439441
@classmethod
440442
def setUpClass(cls):
@@ -502,8 +504,8 @@ def test(self):
502504
self.run_test(["Alice", "Bob"])
503505

504506

505-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
506-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
507+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
508+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
507509
class TestBothRemoteSameNodeSameReg(TestBothRemoteSameNodeDiffReg):
508510
@staticmethod
509511
@inlineCallbacks
@@ -547,8 +549,8 @@ def alice(qReg, virtRoot, myName, classicalNet, send_end):
547549
reactor.stop()
548550

549551

550-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
551-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
552+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
553+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
552554
class TestRemoteAtoB(TestBothRemoteSameNodeDiffReg):
553555
@staticmethod
554556
@inlineCallbacks
@@ -581,8 +583,8 @@ def alice(qReg, virtRoot, myName, classicalNet, send_end):
581583
reactor.stop()
582584

583585

584-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
585-
@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
586+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs refactoring to use NetQASM")
587+
#@pytest.mark.skip(reason="Uses deprecated internal APIs - needs updating to new API")
586588
class TestRemoteBtoA(TestBothRemoteSameNodeDiffReg):
587589
@staticmethod
588590
@inlineCallbacks

0 commit comments

Comments
 (0)