Skip to content

Commit

Permalink
Merge pull request #5342 from hypothesis/remove-unused-fixtures
Browse files Browse the repository at this point in the history
Remove unused pytest fixtures
  • Loading branch information
robertknight committed Oct 4, 2018
2 parents a351045 + 5f5a9cb commit 6b9d519
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 66 deletions.
10 changes: 0 additions & 10 deletions tests/h/accounts/schemas_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from pyramid.exceptions import BadCSRFToken

from h.accounts import schemas
from h.services.user import UserService
from h.services.user_password import UserPasswordService


Expand Down Expand Up @@ -339,15 +338,6 @@ def user_model(patch):
return patch('h.accounts.schemas.models.User')


@pytest.fixture
def user_service(db_session, pyramid_config):
service = Mock(spec_set=UserService(default_authority='example.com',
session=db_session))
service.fetch_for_login.return_value = None
pyramid_config.register_service(service, name='user')
return service


@pytest.fixture
def user_password_service(pyramid_config):
service = Mock(spec_set=UserPasswordService())
Expand Down
12 changes: 0 additions & 12 deletions tests/h/auth/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,6 @@ def auth_client(factories):
grant_type=GrantType.client_credentials)


@pytest.fixture
def basic_auth_creds(patch):
basic_auth_creds = patch('h.auth.util.basic_auth_creds')
basic_auth_creds.return_value = None
return basic_auth_creds


@pytest.fixture
def valid_auth(basic_auth_creds, auth_client):
basic_auth_creds.return_value = (auth_client.id, auth_client.secret)


@pytest.fixture
def principals_for_user(patch):
return patch('h.auth.util.principals_for_user')
Expand Down
9 changes: 0 additions & 9 deletions tests/h/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,6 @@ def invalid_form(errors=None):
return invalid_form


@pytest.fixture
def mailer(pyramid_config):
from pyramid_mailer.interfaces import IMailer
from pyramid_mailer.testing import DummyMailer
mailer = DummyMailer()
pyramid_config.registry.registerUtility(mailer, IMailer)
return mailer


@pytest.fixture
def matchers():
from ..common import matchers
Expand Down
5 changes: 0 additions & 5 deletions tests/h/services/list_groups_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,6 @@ def user(factories, authority):
return factories.User(authority=authority)


@pytest.fixture
def alternate_user(factories, alternate_authority):
return factories.User(authority=alternate_authority)


@pytest.fixture
def origin():
return 'http://foo.com'
Expand Down
4 changes: 0 additions & 4 deletions tests/h/services/oauth_validator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,6 @@ def test_it_skips_deleting_when_authz_code_is_missing(self, svc, oauth_request,

assert db_session.query(models.AuthzCode).get(keep_code.id) is not None

@pytest.fixture
def authz_code(self, factories):
return factories.AuthzCode()


class TestInvalidateRefreshToken(object):
def test_it_shortens_refresh_token_expires(self, svc, oauth_request, token, utcnow):
Expand Down
17 changes: 0 additions & 17 deletions tests/h/views/accounts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,6 @@ def authenticated_userid(self, pyramid_config):
return userid


@pytest.fixture
def session(patch):
return patch('h.views.accounts.session')


@pytest.fixture
def subscriptions_model(patch):
return patch('h.models.Subscriptions')
Expand All @@ -939,20 +934,8 @@ def mailer(patch):
return patch('h.views.accounts.mailer')


@pytest.fixture
def models(patch):
return patch('h.views.accounts.models')


@pytest.fixture
def user_password_service(pyramid_config):
service = mock.Mock(spec_set=UserPasswordService())
pyramid_config.register_service(service, name='user_password')
return service


@pytest.fixture
def user_signup_service(pyramid_config):
service = mock.Mock(spec_set=['signup'])
pyramid_config.register_service(service, name='user_signup')
return service
9 changes: 0 additions & 9 deletions tests/h/views/api/annotations_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ def search_lib(self, patch):
def search_run(self, search_lib):
return search_lib.Search.return_value.run

@pytest.fixture
def storage(self, patch):
return patch('h.views.api.annotations.storage')


@pytest.mark.usefixtures('AnnotationEvent',
'create_schema',
Expand Down Expand Up @@ -447,11 +443,6 @@ def pyramid_request(pyramid_request):
return pyramid_request


@pytest.fixture
def search_lib(patch):
return patch('h.views.api.annotations.search_lib')


@pytest.fixture
def storage(patch):
return patch('h.views.api.annotations.storage')

0 comments on commit 6b9d519

Please sign in to comment.