[Python-checkins] r82562 - in sandbox/trunk/pep362: README setup.py tests/test_pep362.py
Ezio Melotti
ezio.melotti at gmail.com
Mon Jul 5 04:45:43 CEST 2010
On 04/07/2010 23.52, brett.cannon wrote:
> Author: brett.cannon
> Date: Sun Jul 4 22:52:17 2010
> New Revision: 82562
>
> Log:
> Update to run under Python 2.7 and 3.1 without any warnings.
>
> Modified:
> sandbox/trunk/pep362/README
> sandbox/trunk/pep362/setup.py
> sandbox/trunk/pep362/tests/test_pep362.py
>
> Modified: sandbox/trunk/pep362/README
> ==============================================================================
> --- sandbox/trunk/pep362/README (original)
> +++ sandbox/trunk/pep362/README Sun Jul 4 22:52:17 2010
> @@ -38,6 +38,11 @@
>
> The version number will get bumped as open issues in the PEP are closed.
>
> +0.6.2
> +-----
> +
> +* Move test suite over to assert* methods.
> +
> 0.6
> ---
>
>
> Modified: sandbox/trunk/pep362/setup.py
> ==============================================================================
> --- sandbox/trunk/pep362/setup.py (original)
> +++ sandbox/trunk/pep362/setup.py Sun Jul 4 22:52:17 2010
> @@ -3,7 +3,7 @@
> [...]
> @version_specific(2)
> def test_parameter_tuple(self):
> # A function with a tuple as a parameter should work.
> sig = pep362.Signature(pep362_py2_fodder.tuple_args)
> - self.failUnlessEqual('tuple_args', sig.name)
> + self.assertEqual('tuple_args', sig.name)
> param = list(sig)[0]
> - self.failUnless(isinstance(param.name, tuple))
> - self.failUnlessEqual(('a', ('b',)), param.name)
> - self.failUnlessEqual(0, param.position)
> - self.failUnless(not hasattr(param, 'default_value'))
> + self.assertTrue(isinstance(param.name, tuple))
This could be an assertIsInstance (unless you need to support Python <=2.6).
> + self.assertEqual(('a', ('b',)), param.name)
> + self.assertEqual(0, param.position)
> + self.assertTrue(not hasattr(param, 'default_value'))
This and several others could use assertFalse, instead of assertTrue(not
...)
>
> [...]
Best Regards,
Ezio Melotti
More information about the Python-checkins
mailing list