From 70d07ba9e65fd715e79541a164aaadb9d9304e06 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 30 Apr 2013 17:57:46 -0400 Subject: [PATCH] Resolve a few differences in TypeError messaging in Python 3.3. --- pecan/tests/test_base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pecan/tests/test_base.py b/pecan/tests/test_base.py index 29278f1..37751b7 100644 --- a/pecan/tests/test_base.py +++ b/pecan/tests/test_base.py @@ -250,7 +250,10 @@ class TestControllerArguments(PecanTestCase): assert r.status_int != 200 # pragma: nocover except Exception as ex: assert type(ex) == TypeError - assert ex.args[0] == 'index() takes exactly 2 arguments (1 given)' + assert ex.args[0] in ( + "index() takes exactly 2 arguments (1 given)", + "index() missing 1 required positional argument: 'id'" + ) # this messaging changed in Python 3.3 def test_single_argument(self): r = self.app_.get('/1') @@ -649,7 +652,10 @@ class TestControllerArguments(PecanTestCase): assert r.status_int != 200 # pragma: nocover except Exception as ex: assert type(ex) == TypeError - assert ex.args[0] == 'eater() takes at least 2 arguments (1 given)' + assert ex.args[0] in ( + "eater() takes at least 2 arguments (1 given)", + "eater() missing 1 required positional argument: 'id'" + ) # this messaging changed in Python 3.3 def test_one_remainder(self): r = self.app_.get('/eater/1')