Skip to content

Commit

Permalink
tests: Fixing how the V fixture is shared
Browse files Browse the repository at this point in the history
  • Loading branch information
delfick committed Jul 27, 2022
1 parent 125e54e commit 8902a8b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
15 changes: 12 additions & 3 deletions modules/tests/photons_transport_tests/comms/test_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@pytest.fixture()
def V():
def VBase():
class V:
final_future = hp.create_future()

Expand All @@ -39,6 +39,11 @@ def communication(s):
return V()


@pytest.fixture()
def V(VBase):
return VBase


@pytest.fixture(autouse=True)
async def cleanup(V):
try:
Expand Down Expand Up @@ -375,7 +380,9 @@ def __eq__(s, other):
describe "find_specific_serials":

@pytest.fixture()
def V(self, V):
def V(self, VBase):
V = VBase

class V(V.__class__):
info1 = mock.Mock(name="info1")
info2 = mock.Mock(name="info2")
Expand Down Expand Up @@ -673,7 +680,9 @@ async def _do_search(serials, timeout, **kwargs):
describe "private transport_for_send":

@pytest.fixture()
def V(self, V):
def V(self, VBase):
V = VBase

class V(V.__class__):
packet = mock.Mock(name="packet")
original = mock.Mock(name="original")
Expand Down
11 changes: 9 additions & 2 deletions modules/tests/photons_transport_tests/comms/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


@pytest.fixture()
def V():
def VBase():
class V:
original = mock.Mock(name="original")
Meta = mock.NonCallableMock(name="Meta", spec=["multi"])
Expand All @@ -39,6 +39,11 @@ def gaps(s):
return V()


@pytest.fixture()
def V(VBase):
return VBase


gaps = Gaps(
gap_between_ack_and_res=0.2, gap_between_results=0.2, timeouts=[(0.1, 0.1)]
).empty_normalise()
Expand Down Expand Up @@ -78,7 +83,9 @@ def gaps(s):
describe "add_packet":

@pytest.fixture()
def V(self, V):
def V(self, VBase):
V = VBase

class V(V.__class__):
pkt = mock.NonCallableMock(name="pkt", spec=["represents_ack"])
addr = mock.Mock(name="addr")
Expand Down

0 comments on commit 8902a8b

Please sign in to comment.