Skip to content

Commit

Permalink
Reduce deprectation warnings during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
defnull committed Mar 4, 2023
1 parent 486898d commit c04c794
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ def test_meta(self):
c['bool'] = 'I am so true!'
c['int'] = '6'
self.assertTrue(c['bool'] is True)
self.assertEquals(c['int'], 6)
self.assertEqual(c['int'], 6)
self.assertRaises(ValueError, lambda: c.update(int='not an int'))

def test_load_dict(self):
c = ConfigDict()
d = dict(a=dict(b=dict(foo=5, bar=6), baz=7))
c.load_dict(d)
self.assertEquals(c['a.b.foo'], 5)
self.assertEquals(c['a.b.bar'], 6)
self.assertEquals(c['a.baz'], 7)
self.assertEqual(c['a.b.foo'], 5)
self.assertEqual(c['a.b.bar'], 6)
self.assertEqual(c['a.baz'], 7)

if __name__ == '__main__': #pragma: no cover
unittest.main()
Expand Down
4 changes: 2 additions & 2 deletions test/test_environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _test_chunked(self, body, expect):
e['wsgi.input'].seek(0)
e['HTTP_TRANSFER_ENCODING'] = 'chunked'
if isinstance(expect, str):
self.assertEquals(tob(expect), BaseRequest(e).body.read())
self.assertEqual(tob(expect), BaseRequest(e).body.read())
else:
self.assertRaises(expect, lambda: BaseRequest(e).body)

Expand Down Expand Up @@ -581,7 +581,7 @@ def test(): rs.status = '555' # No reason
def test_content_type(self):
rs = BaseResponse()
rs.content_type = 'test/some'
self.assertEquals('test/some', rs.headers.get('Content-Type'))
self.assertEqual('test/some', rs.headers.get('Content-Type'))

def test_charset(self):
rs = BaseResponse()
Expand Down
4 changes: 2 additions & 2 deletions test/test_importhook.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
import unittest
import sys, os
import imp
from bottle import new_module

class TestImportHooks(unittest.TestCase):

def make_module(self, name, **args):
mod = sys.modules.setdefault(name, imp.new_module(name))
mod = sys.modules.setdefault(name, new_module(name))
mod.__file__ = '<virtual %s>' % name
mod.__dict__.update(**args)
return mod
Expand Down
2 changes: 1 addition & 1 deletion test/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class Plugin(object):
def __call__(self, func): return func
def setup(self, app): self.app = app
plugin = self.app.install(Plugin())
self.assertEquals(getattr(plugin, 'app', None), self.app)
self.assertEqual(getattr(plugin, 'app', None), self.app)

def test_close(self):
class Plugin(object):
Expand Down
2 changes: 1 addition & 1 deletion test/test_stpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_data(self):
self.assertRenders('<{{var}}>', '<[1, 2]>', var=[1,2])

def test_htmlutils_quote(self):
self.assertEquals('"&lt;&#039;&#13;&#10;&#9;&quot;\\&gt;"', html_quote('<\'\r\n\t"\\>'));
self.assertEqual('"&lt;&#039;&#13;&#10;&#9;&quot;\\&gt;"', html_quote('<\'\r\n\t"\\>'));

def test_escape(self):
self.assertRenders('<{{var}}>', '<b>', var='b')
Expand Down
2 changes: 1 addition & 1 deletion test/test_wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def test(): return dict(a=5)
def test_name(self):
@bottle.route(name='foo')
def test(x=5): return 'ok'
self.assertEquals('/test/6', bottle.url('foo', x=6))
self.assertEqual('/test/6', bottle.url('foo', x=6))

def test_callback(self):
def test(x=5): return str(x)
Expand Down

0 comments on commit c04c794

Please sign in to comment.