diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-08-19 07:00:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-19 07:00:11 (GMT) |
commit | 77d5781835b6e0a132694ebadc22b1cbdb9913f8 (patch) | |
tree | 4f572a64ee84c9e8afb960e384181f1dd11d5c7f /Lib/unittest/case.py | |
parent | e349bf23584eef20e0d1e1b2989d9b1430f15507 (diff) | |
download | cpython-77d5781835b6e0a132694ebadc22b1cbdb9913f8.zip cpython-77d5781835b6e0a132694ebadc22b1cbdb9913f8.tar.gz cpython-77d5781835b6e0a132694ebadc22b1cbdb9913f8.tar.bz2 |
bpo-34318: Convert deprecation warnings to errors in assertRaises() etc. (GH-8623)
Diffstat (limited to 'Lib/unittest/case.py')
-rw-r--r-- | Lib/unittest/case.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index c0170d1..1faa6b6 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -157,16 +157,11 @@ class _AssertRaisesBaseContext(_BaseTestCaseContext): if not _is_subtype(self.expected, self._base_type): raise TypeError('%s() arg 1 must be %s' % (name, self._base_type_str)) - if args and args[0] is None: - warnings.warn("callable is None", - DeprecationWarning, 3) - args = () if not args: self.msg = kwargs.pop('msg', None) if kwargs: - warnings.warn('%r is an invalid keyword argument for ' - 'this function' % next(iter(kwargs)), - DeprecationWarning, 3) + raise TypeError('%r is an invalid keyword argument for ' + 'this function' % (next(iter(kwargs)),)) return self callable_obj, *args = args |