mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-14 12:10:24 +08:00
TEST: Template in module name.
Fixes failures when tests are invoked from different paths.
This commit is contained in:
@@ -175,8 +175,9 @@ class PreprocessTestCase(TestCase):
|
|||||||
foo(not_int(1), 2, 3)
|
foo(not_int(1), 2, 3)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
e.exception.args[0],
|
e.exception.args[0],
|
||||||
"tests.utils.test_preprocess.foo() expected a value of type "
|
"{modname}.foo() expected a value of type "
|
||||||
"int for argument 'a', but got {t} instead.".format(
|
"int for argument 'a', but got {t} instead.".format(
|
||||||
|
modname=foo.__module__,
|
||||||
t=not_int.__name__,
|
t=not_int.__name__,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -197,9 +198,9 @@ class PreprocessTestCase(TestCase):
|
|||||||
foo('1')
|
foo('1')
|
||||||
|
|
||||||
expected_message = (
|
expected_message = (
|
||||||
"tests.utils.test_preprocess.foo() expected a value of "
|
"{modname}.foo() expected a value of "
|
||||||
"type int or float for argument 'a', but got str instead."
|
"type int or float for argument 'a', but got str instead."
|
||||||
)
|
).format(modname=foo.__module__)
|
||||||
self.assertEqual(e.exception.args[0], expected_message)
|
self.assertEqual(e.exception.args[0], expected_message)
|
||||||
|
|
||||||
def test_expect_optional_types(self):
|
def test_expect_optional_types(self):
|
||||||
@@ -219,7 +220,7 @@ class PreprocessTestCase(TestCase):
|
|||||||
foo('1')
|
foo('1')
|
||||||
|
|
||||||
expected_message = (
|
expected_message = (
|
||||||
"tests.utils.test_preprocess.foo() expected a value of "
|
"{modname}.foo() expected a value of "
|
||||||
"type int or NoneType for argument 'a', but got str instead."
|
"type int or NoneType for argument 'a', but got str instead."
|
||||||
)
|
).format(modname=foo.__module__)
|
||||||
self.assertEqual(e.exception.args[0], expected_message)
|
self.assertEqual(e.exception.args[0], expected_message)
|
||||||
|
|||||||
Reference in New Issue
Block a user