Skip to content

Commit

Permalink
Remove autouse from fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
kiendang committed Oct 26, 2023
1 parent df1a184 commit e5b265d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions packages/syft/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,43 +68,43 @@ def stage_protocol(protocol_file: Path):
dp.save_history(dp.protocol_history)


@pytest.fixture(autouse=True)
@pytest.fixture()
def worker(faker, stage_protocol):
return sy.Worker.named(name=faker.name())


@pytest.fixture(autouse=True)
@pytest.fixture()
def root_domain_client(worker):
return worker.root_client


@pytest.fixture(autouse=True)
@pytest.fixture()
def root_verify_key(worker):
return worker.root_client.credentials.verify_key


@pytest.fixture(autouse=True)
@pytest.fixture()
def guest_client(worker):
return worker.guest_client


@pytest.fixture(autouse=True)
@pytest.fixture()
def guest_verify_key(worker):
return worker.guest_client.credentials.verify_key


@pytest.fixture(autouse=True)
@pytest.fixture()
def guest_domain_client(root_domain_client):
return root_domain_client.guest()


@pytest.fixture(autouse=True)
@pytest.fixture()
def document_store(worker):
yield worker.document_store
worker.document_store.reset()


@pytest.fixture(autouse=True)
@pytest.fixture()
def action_store(worker):
return worker.action_store

Expand Down
12 changes: 6 additions & 6 deletions packages/syft/tests/syft/notifications/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
test_verify_key = SyftVerifyKey.from_string(test_verify_key_string)


@pytest.fixture(autouse=True)
@pytest.fixture()
def notification_stash(document_store):
return NotificationStash(store=document_store)


@pytest.fixture(autouse=True)
@pytest.fixture()
def notification_service(document_store):
return NotificationService(store=document_store)


@pytest.fixture(autouse=True)
@pytest.fixture()
def authed_context(admin_user: User, worker: Worker) -> AuthedServiceContext:
return AuthedServiceContext(credentials=test_verify_key, node=worker)


@pytest.fixture(autouse=True)
@pytest.fixture()
def linked_object():
return LinkedObject(
node_uid=UID(),
Expand All @@ -47,7 +47,7 @@ def linked_object():
)


@pytest.fixture(autouse=True)
@pytest.fixture()
def mock_create_notification(faker) -> CreateNotification:
test_signing_key1 = SyftSigningKey.generate()
test_verify_key1 = test_signing_key1.verify_key
Expand All @@ -66,7 +66,7 @@ def mock_create_notification(faker) -> CreateNotification:
return mock_notification


@pytest.fixture(autouse=True)
@pytest.fixture()
def mock_notification(
root_verify_key,
notification_stash: NotificationStash,
Expand Down
18 changes: 9 additions & 9 deletions packages/syft/tests/syft/users/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from syft.store.document_store import DocumentStore


@pytest.fixture(autouse=True)
@pytest.fixture()
def admin_create_user(faker) -> UserCreate:
password = faker.password()
user_create = UserCreate(
Expand All @@ -34,7 +34,7 @@ def admin_create_user(faker) -> UserCreate:
return user_create


@pytest.fixture(autouse=True)
@pytest.fixture()
def guest_create_user(faker) -> UserCreate:
password = faker.password()
user_create = UserCreate(
Expand All @@ -49,25 +49,25 @@ def guest_create_user(faker) -> UserCreate:
return user_create


@pytest.fixture(autouse=True)
@pytest.fixture()
def admin_user(admin_create_user) -> User:
user = admin_create_user.to(User)
return user


@pytest.fixture(autouse=True)
@pytest.fixture()
def guest_user(guest_create_user) -> User:
user = guest_create_user.to(User)
return user


@pytest.fixture(autouse=True)
@pytest.fixture()
def admin_view_user(admin_user) -> UserView:
user_view = admin_user.to(UserView)
return user_view


@pytest.fixture(autouse=True)
@pytest.fixture()
def guest_view_user(guest_user) -> UserView:
user_view = guest_user.to(UserView)
return user_view
Expand All @@ -90,22 +90,22 @@ def guest_user_private_key(guest_user) -> UserPrivateKey:
)


@pytest.fixture(autouse=True)
@pytest.fixture()
def update_user(faker) -> UserSearch:
return UserUpdate(
name=faker.name(),
email=faker.email(),
)


@pytest.fixture(autouse=True)
@pytest.fixture()
def guest_user_search(guest_user) -> UserSearch:
return UserSearch(
name=guest_user.name, email=guest_user.email, verify_key=guest_user.verify_key
)


@pytest.fixture(autouse=True)
@pytest.fixture()
def user_stash(document_store: DocumentStore) -> UserStash:
return UserStash(store=document_store)

Expand Down

0 comments on commit e5b265d

Please sign in to comment.