Skip to content

Commit 5a0cca8

Browse files
committed
Try adding a service fixture
1 parent 617d436 commit 5a0cca8

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

tests/conftest.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
from warehouse.email.interfaces import IEmailSender
5353
from warehouse.helpdesk import services as helpdesk_services
5454
from warehouse.helpdesk.interfaces import IAdminNotificationService, IHelpDeskService
55+
from warehouse.legacy.api.xmlrpc.cache import services as xmlrpc_services
56+
from warehouse.legacy.api.xmlrpc.cache.interfaces import IXMLRPCCache
5557
from warehouse.macaroons import services as macaroon_services
5658
from warehouse.macaroons.interfaces import IMacaroonService
5759
from warehouse.metrics import IMetricsService
@@ -163,6 +165,7 @@ def pyramid_services(
163165
macaroon_service,
164166
helpdesk_service,
165167
notification_service,
168+
xmlrpccache_service,
166169
):
167170
services = _Services()
168171

@@ -186,6 +189,7 @@ def pyramid_services(
186189
services.register_service(macaroon_service, IMacaroonService, None, name="")
187190
services.register_service(helpdesk_service, IHelpDeskService, None)
188191
services.register_service(notification_service, IAdminNotificationService)
192+
services.register_service(xmlrpccache_service, IXMLRPCCache)
189193

190194
return services
191195

@@ -331,7 +335,7 @@ def get_app_config(database, nondefaults=None):
331335
"sessions.secret": "123456",
332336
"sessions.url": "redis://localhost:0/",
333337
"statuspage.url": "https://2p66nmmycsj3.statuspage.io",
334-
"warehouse.xmlrpc.cache.url": "redis://localhost:0/",
338+
"warehouse.xmlrpc.cache.url": "null://",
335339
"terms.revision": "initial",
336340
}
337341

@@ -524,6 +528,14 @@ def notification_service():
524528
return helpdesk_services.ConsoleAdminNotificationService()
525529

526530

531+
@pytest.fixture
532+
def xmlrpccache_service():
533+
def purger(tags):
534+
return None
535+
536+
return xmlrpc_services.NullXMLRPCCache("null://", purger)
537+
538+
527539
class QueryRecorder:
528540
def __init__(self):
529541
self.queries = []

tests/unit/packaging/test_typosnyper.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ def test_typo_check_name(name, expected):
4848
assert typo_check_name(name, corpus=test_names_corpus) == expected
4949

5050

51-
def test_check_typo_after_commit(db_request, monkeypatch):
52-
# db_request.config.find_service_factory = pretend.raiser(LookupError)
53-
51+
def test_check_typo_after_commit(db_request):
5452
project = Project(name="foobar")
5553
db_request.db.add(project)
5654
db_request.db.commit()

0 commit comments

Comments
 (0)