tests: drop pkg_resources from test_auditor.py
We need to get rid of pkg_resources for py312. Fortunately, we already use the load_pkg_resources() wrapper everywhere. And, the tests of watchers already mock it. So, the general mocking of pkg_resources was not doing anything, and this patch simply deletes it. Change-Id: Ifbdbbe18d6df6df377f0d914a097328d9c9e95ee
This commit is contained in:
parent
d31a54a65c
commit
002ad59c9e
@ -16,7 +16,7 @@
|
||||
#
|
||||
# This is an audit watcher that manages the dark data in the cluster.
|
||||
# Since the API for audit watchers is intended to use external plugins,
|
||||
# this code is invoked as if it were external: through pkg_resources.
|
||||
# this code is invoked as if it were external: through load_pkg_resources().
|
||||
# Our setup.py comes pre-configured for convenience, but the operator has
|
||||
# to enable this watcher honestly by additing DarkDataWatcher to watchers=
|
||||
# in object-server.conf. The default is off, as if this does not exist.
|
||||
|
@ -17,7 +17,6 @@ import unittest
|
||||
import json
|
||||
import mock
|
||||
import os
|
||||
import pkg_resources
|
||||
import signal
|
||||
import string
|
||||
import sys
|
||||
@ -67,13 +66,6 @@ def works_only_once(callable_thing, exception):
|
||||
return only_once
|
||||
|
||||
|
||||
def no_audit_watchers(group, name=None):
|
||||
if group == 'swift.object_audit_watcher':
|
||||
return iter([])
|
||||
else:
|
||||
return pkg_resources.iter_entry_points(group, name)
|
||||
|
||||
|
||||
class FakeRing1(object):
|
||||
|
||||
def __init__(self, swift_dir, ring_name=None):
|
||||
@ -1595,7 +1587,6 @@ class TestAuditor(TestAuditorBase):
|
||||
.format(outstanding_pids))
|
||||
|
||||
|
||||
@mock.patch('pkg_resources.iter_entry_points', no_audit_watchers)
|
||||
@patch_policies(_mocked_policies)
|
||||
class TestAuditWatchers(TestAuditorBase):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user