diff options
| author | Sergey Maranchuk <slav0nic@python.su> | 2020-04-17 22:12:06 +0300 |
|---|---|---|
| committer | Sergey Maranchuk <slav0nic@python.su> | 2020-04-17 22:12:06 +0300 |
| commit | 6668e43d2d67db4574e08a9d54bd80eb105c1b28 (patch) | |
| tree | 10eda61b15ae53815af24af956267e2f632a46f7 /tests/test_config | |
| parent | 48cf45b0a1ac04e701101fa18778164825edd429 (diff) | |
| download | pyramid-6668e43d2d67db4574e08a9d54bd80eb105c1b28.tar.gz pyramid-6668e43d2d67db4574e08a9d54bd80eb105c1b28.tar.bz2 pyramid-6668e43d2d67db4574e08a9d54bd80eb105c1b28.zip | |
inheriting from `object` not necessary in py3
Diffstat (limited to 'tests/test_config')
| -rw-r--r-- | tests/test_config/__init__.py | 4 | ||||
| -rw-r--r-- | tests/test_config/pkgs/scannable/__init__.py | 10 | ||||
| -rw-r--r-- | tests/test_config/pkgs/scannable/another.py | 6 | ||||
| -rw-r--r-- | tests/test_config/test_actions.py | 4 | ||||
| -rw-r--r-- | tests/test_config/test_adapters.py | 12 | ||||
| -rw-r--r-- | tests/test_config/test_assets.py | 2 | ||||
| -rw-r--r-- | tests/test_config/test_init.py | 12 | ||||
| -rw-r--r-- | tests/test_config/test_predicates.py | 8 | ||||
| -rw-r--r-- | tests/test_config/test_routes.py | 2 | ||||
| -rw-r--r-- | tests/test_config/test_tweens.py | 2 | ||||
| -rw-r--r-- | tests/test_config/test_views.py | 78 |
11 files changed, 70 insertions, 70 deletions
diff --git a/tests/test_config/__init__.py b/tests/test_config/__init__.py index 99677ebc5..1fb1cd53e 100644 --- a/tests/test_config/__init__.py +++ b/tests/test_config/__init__.py @@ -33,7 +33,7 @@ class DummyContext: @implementer(IFactory) -class DummyFactory(object): +class DummyFactory: def __call__(self): """ """ @@ -61,7 +61,7 @@ def dummy_extend2(config, discrim): dummy_partial = partial(dummy_extend, discrim='partial') -class DummyCallable(object): +class DummyCallable: def __call__(self, config, discrim): config.action(discrim, None, config.package) diff --git a/tests/test_config/pkgs/scannable/__init__.py b/tests/test_config/pkgs/scannable/__init__.py index e0042a5cc..f0e730e15 100644 --- a/tests/test_config/pkgs/scannable/__init__.py +++ b/tests/test_config/pkgs/scannable/__init__.py @@ -18,7 +18,7 @@ def stacked(context, request): return 'stacked' -class stacked_class(object): +class stacked_class: def __init__(self, context, request): self.context = context self.request = request @@ -49,7 +49,7 @@ oldstyle_grokked_class = view_config( )(oldstyle_grokked_class) -class grokked_class(object): +class grokked_class: def __init__(self, context, request): self.context = context self.request = request @@ -63,7 +63,7 @@ grokked_class = view_config(name='grokked_class', renderer=null_renderer)( ) -class Foo(object): +class Foo: def __call__(self, context, request): return 'grokked_instance' @@ -74,7 +74,7 @@ grokked_instance = view_config( )(grokked_instance) -class Base(object): +class Base: @view_config(name='basemethod', renderer=null_renderer) def basemethod(self): """ """ @@ -109,7 +109,7 @@ def stuff(): """ """ -class Whatever(object): +class Whatever: pass diff --git a/tests/test_config/pkgs/scannable/another.py b/tests/test_config/pkgs/scannable/another.py index 31e7f5128..8a1c726a0 100644 --- a/tests/test_config/pkgs/scannable/another.py +++ b/tests/test_config/pkgs/scannable/another.py @@ -18,7 +18,7 @@ def stacked(context, request): return 'another_stacked' -class stacked_class(object): +class stacked_class: def __init__(self, context, request): self.context = context self.request = request @@ -49,7 +49,7 @@ oldstyle_grokked_class = view_config( )(oldstyle_grokked_class) -class grokked_class(object): +class grokked_class: def __init__(self, context, request): self.context = context self.request = request @@ -63,7 +63,7 @@ grokked_class = view_config( )(grokked_class) -class Foo(object): +class Foo: def __call__(self, context, request): return 'another_grokked_instance' diff --git a/tests/test_config/test_actions.py b/tests/test_config/test_actions.py index aa86f3792..b1f4b4b99 100644 --- a/tests/test_config/test_actions.py +++ b/tests/test_config/test_actions.py @@ -1072,7 +1072,7 @@ def _conflictFunctions(e): yield confinst.function -class DummyActionState(object): +class DummyActionState: autocommit = False info = '' @@ -1083,7 +1083,7 @@ class DummyActionState(object): self.actions.append((arg, kw)) -class DummyIntrospectable(object): +class DummyIntrospectable: def __init__(self): self.registered = [] diff --git a/tests/test_config/test_adapters.py b/tests/test_config/test_adapters.py index 60a4f3090..8c7f00751 100644 --- a/tests/test_config/test_adapters.py +++ b/tests/test_config/test_adapters.py @@ -244,7 +244,7 @@ class AdaptersConfiguratorMixinTests(unittest.TestCase): config = self._makeOne(autocommit=True) - class Adapter(object): + class Adapter: def __init__(self, other): self.other = other @@ -257,7 +257,7 @@ class AdaptersConfiguratorMixinTests(unittest.TestCase): config = self._makeOne(autocommit=True) - class Adapter(object): + class Adapter: pass config.add_response_adapter(None, Adapter) @@ -396,23 +396,23 @@ class Test_eventonly(unittest.TestCase): self.assertTrue(self._callFUT(acallable)) -class DummyTraverser(object): +class DummyTraverser: def __init__(self, root): self.root = root -class DummyIface(object): +class DummyIface: pass -class DummyResourceURL(object): +class DummyResourceURL: def __init__(self, resource, request): self.resource = resource self.request = request def predicate_maker(name): - class Predicate(object): + class Predicate: def __init__(self, val, config): self.val = val diff --git a/tests/test_config/test_assets.py b/tests/test_config/test_assets.py index cfd786c5d..3cfea7fe4 100644 --- a/tests/test_config/test_assets.py +++ b/tests/test_config/test_assets.py @@ -820,7 +820,7 @@ class TestPackageOverrides(unittest.TestCase): self.assertEqual(loader._got_source, 'whatever') -class AssetSourceIntegrationTests(object): +class AssetSourceIntegrationTests: def test_get_filename(self): source = self._makeOne('') self.assertEqual( diff --git a/tests/test_config/test_init.py b/tests/test_config/test_init.py index ebcd78bb6..5ca3063c5 100644 --- a/tests/test_config/test_init.py +++ b/tests/test_config/test_init.py @@ -435,10 +435,10 @@ class ConfiguratorTests(unittest.TestCase): pass @implementer(IFoo) - class Foo(object): + class Foo: pass - class Bar(object): + class Bar: pass adaptation = () @@ -925,7 +925,7 @@ test_config.dummy_include2""" config = self._makeOne() - class DummyInspect(object): + class DummyInspect: def getmodule(self, c): return inspect.getmodule(c) @@ -1419,7 +1419,7 @@ class DummyRequest: self.cookies = {} -class DummyThreadLocalManager(object): +class DummyThreadLocalManager: def __init__(self): self.pushed = {'registry': None, 'request': None} self.popped = False @@ -1434,7 +1434,7 @@ class DummyThreadLocalManager(object): self.popped = True -class DummyRegistry(object): +class DummyRegistry: def __init__(self, adaptation=None, util=None): self.utilities = [] self.adapters = [] @@ -1458,5 +1458,5 @@ class DummyRegistry(object): return self.util -class DummyPredicate(object): +class DummyPredicate: pass diff --git a/tests/test_config/test_predicates.py b/tests/test_config/test_predicates.py index f8abbbce4..d1562947e 100644 --- a/tests/test_config/test_predicates.py +++ b/tests/test_config/test_predicates.py @@ -200,7 +200,7 @@ class TestPredicateList(unittest.TestCase): def test_different_custom_predicates_with_same_hash(self): from pyramid.config.predicates import predvalseq - class PredicateWithHash(object): + class PredicateWithHash: def __hash__(self): return 1 @@ -443,7 +443,7 @@ class Test_sort_accept_offers(unittest.TestCase): ) -class DummyCustomPredicate(object): +class DummyCustomPredicate: def __init__(self): self.__text__ = 'custom predicate' @@ -458,7 +458,7 @@ class DummyCustomPredicate(object): pass # pragma: no cover -class Dummy(object): +class Dummy: def __init__(self, **kw): self.__dict__.update(**kw) @@ -475,7 +475,7 @@ class DummyRequest: self.cookies = {} -class DummyConfigurator(object): +class DummyConfigurator: package = 'dummy package' registry = 'dummy registry' diff --git a/tests/test_config/test_routes.py b/tests/test_config/test_routes.py index bbafa8784..8227784ec 100644 --- a/tests/test_config/test_routes.py +++ b/tests/test_config/test_routes.py @@ -332,7 +332,7 @@ class DummyRequest: self.cookies = {} -class DummyAccept(object): +class DummyAccept: def __init__(self, *matches, **kw): self.matches = list(matches) self.contains = kw.pop('contains', False) diff --git a/tests/test_config/test_tweens.py b/tests/test_config/test_tweens.py index ff75461c3..b8cf15e12 100644 --- a/tests/test_config/test_tweens.py +++ b/tests/test_config/test_tweens.py @@ -117,7 +117,7 @@ class TestTweensConfiguratorMixin(unittest.TestCase): def test_add_tween_instance(self): from pyramid.exceptions import ConfigurationError - class ATween(object): + class ATween: pass atween = ATween() diff --git a/tests/test_config/test_views.py b/tests/test_config/test_views.py index 3aecc721a..6b34f1bd4 100644 --- a/tests/test_config/test_views.py +++ b/tests/test_config/test_views.py @@ -1322,13 +1322,13 @@ class TestViewsConfigurationMixin(unittest.TestCase): from pyramid.renderers import null_renderer as nr from pyramid.router import Router - class OtherBase(object): + class OtherBase: pass - class Int1(object): + class Int1: pass - class Int2(object): + class Int2: pass class Resource(OtherBase, Int1, Int2): @@ -1370,13 +1370,13 @@ class TestViewsConfigurationMixin(unittest.TestCase): from pyramid.renderers import null_renderer as nr from pyramid.router import Router - class OtherBase(object): + class OtherBase: pass - class Int1(object): + class Int1: pass - class Int2(object): + class Int2: pass class Resource(OtherBase, Int1, Int2): @@ -1433,11 +1433,11 @@ class TestViewsConfigurationMixin(unittest.TestCase): pass @implementer(IFoo) - class Foo(object): + class Foo: pass @implementer(IBar) - class Bar(object): + class Bar: pass foo = Foo() @@ -1468,7 +1468,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): from tests import test_config from pyramid.interfaces import ISettings - class view(object): + class view: def __init__(self, context, request): self.request = request self.context = context @@ -1494,7 +1494,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): self.assertEqual(result.settings, settings) def test_add_view_with_default_renderer(self): - class view(object): + class view: def __init__(self, context, request): self.request = request self.context = context @@ -1504,7 +1504,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): config = self._makeOne(autocommit=True) - class moo(object): + class moo: def __init__(self, *arg, **kw): pass @@ -2042,7 +2042,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): view1 = lambda *arg: 'OK' outerself = self - class DummyPolicy(object): + class DummyPolicy: def permits(self, r, context, permission): outerself.assertEqual(r, request) outerself.assertEqual(context, None) @@ -2062,7 +2062,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): view1 = lambda *arg: 'OK' outerself = self - class DummyPolicy(object): + class DummyPolicy: def permits(self, r, context, permission): outerself.assertEqual(r, request) outerself.assertEqual(context, None) @@ -2083,7 +2083,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): view1 = lambda *arg: 'OK' - class DummyPolicy(object): + class DummyPolicy: pass # wont be called policy = DummyPolicy() @@ -2100,7 +2100,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): def test_add_view_with_mapper(self): from pyramid.renderers import null_renderer - class Mapper(object): + class Mapper: def __init__(self, **kw): self.__class__.kw = kw @@ -2122,7 +2122,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): from pyramid.exceptions import PredicateMismatch from zope.interface import directlyProvides - class view(object): + class view: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} def __init__(self, request): @@ -2183,10 +2183,10 @@ class TestViewsConfigurationMixin(unittest.TestCase): def test_add_view_with_view_config_and_view_defaults_doesnt_conflict(self): from pyramid.renderers import null_renderer - class view(object): + class view: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} - class view2(object): + class view2: __view_defaults__ = {'containment': 'tests.test_config.IFactory'} config = self._makeOne(autocommit=False) @@ -2197,10 +2197,10 @@ class TestViewsConfigurationMixin(unittest.TestCase): def test_add_view_with_view_config_and_view_defaults_conflicts(self): from pyramid.renderers import null_renderer - class view(object): + class view: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} - class view2(object): + class view2: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} config = self._makeOne(autocommit=False) @@ -2214,7 +2214,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): config = self._makeOne(autocommit=True) - class DummyViewClass(object): + class DummyViewClass: def run(self): # pragma: no cover pass @@ -2261,7 +2261,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): view = lambda *arg: 'OK' config = self._makeOne(autocommit=True) - class NotAnException(object): + class NotAnException: pass self.assertRaises( @@ -2353,7 +2353,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): from zope.interface import directlyProvides from zope.interface import implementedBy - class view(object): + class view: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} def __init__(self, request): @@ -2401,7 +2401,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): def test_derive_view_with_default_renderer_no_explicit_renderer(self): config = self._makeOne() - class moo(object): + class moo: def __init__(self, view): pass @@ -2419,10 +2419,10 @@ class TestViewsConfigurationMixin(unittest.TestCase): self.assertEqual(result(None, None).body, b'moo') def test_derive_view_with_default_renderer_with_explicit_renderer(self): - class moo(object): + class moo: pass - class foo(object): + class foo: def __init__(self, view): pass @@ -2578,7 +2578,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): from zope.interface import directlyProvides from zope.interface import implementedBy - class view(object): + class view: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} def __init__(self, request): @@ -2742,7 +2742,7 @@ class TestViewsConfigurationMixin(unittest.TestCase): from zope.interface import directlyProvides from zope.interface import implementedBy - class view(object): + class view: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} def __init__(self, request): @@ -3020,7 +3020,7 @@ class Test_requestonly(unittest.TestCase): self.assertTrue(self._callFUT(aview)) def test_otherattr(self): - class AView(object): + class AView: def __init__(self, request, a=1, b=2): # pragma: no cover pass @@ -3465,7 +3465,7 @@ class TestDefaultViewMapper(unittest.TestCase): self.assertRaises(TypeError, result, None, request) def test_view_as_newstyle_class_context_and_request(self): - class view(object): + class view: def __init__(self, context, request): pass @@ -3479,7 +3479,7 @@ class TestDefaultViewMapper(unittest.TestCase): self.assertEqual(result(None, request), 'OK') def test_view_as_newstyle_class_context_and_request_with_attr(self): - class view(object): + class view: def __init__(self, context, request): pass @@ -3493,7 +3493,7 @@ class TestDefaultViewMapper(unittest.TestCase): self.assertEqual(result(None, request), 'OK') def test_view_as_newstyle_class_requestonly(self): - class view(object): + class view: def __init__(self, request): pass @@ -3507,7 +3507,7 @@ class TestDefaultViewMapper(unittest.TestCase): self.assertEqual(result(None, request), 'OK') def test_view_as_newstyle_class_requestonly_with_attr(self): - class view(object): + class view: def __init__(self, request): pass @@ -4185,7 +4185,7 @@ class DummyRegistry: @implementer(IResponse) -class DummyResponse(object): +class DummyResponse: content_type = None default_content_type = None body = None @@ -4210,7 +4210,7 @@ class DummyContext: pass -class DummyAccept(object): +class DummyAccept: def __init__(self, *matches, **kw): self.matches = list(matches) self.contains = kw.pop('contains', False) @@ -4260,7 +4260,7 @@ class DummyMultiView: """ """ -class DummyCacheBuster(object): +class DummyCacheBuster: def __init__(self, token): self.token = token @@ -4293,7 +4293,7 @@ class DummyStaticURLInfo: self.added.append((config, name, spec, kw)) -class DummyViewDefaultsClass(object): +class DummyViewDefaultsClass: __view_defaults__ = {'containment': 'tests.test_config.IDummy'} def __init__(self, request): @@ -4303,7 +4303,7 @@ class DummyViewDefaultsClass(object): return 'OK' -class DummyPredicate(object): +class DummyPredicate: def __init__(self, val, config): self.val = val @@ -4313,7 +4313,7 @@ class DummyPredicate(object): phash = text -class DummyIntrospector(object): +class DummyIntrospector: def __init__(self, getval=None): self.related = [] self.introspectables = [] |
