Author: Konstantin Lopuhin <[email protected]>
Branch:
Changeset: r55737:eea3fbaf4a74
Date: 2012-06-19 08:07 +0400
http://bitbucket.org/pypy/pypy/changeset/eea3fbaf4a74/
Log: #1180 - fix tests - use builtins, add failing test on format
diff --git a/pypy/objspace/std/test/test_newformat.py
b/pypy/objspace/std/test/test_newformat.py
--- a/pypy/objspace/std/test/test_newformat.py
+++ b/pypy/objspace/std/test/test_newformat.py
@@ -211,15 +211,17 @@
class AppTestBoolFormat:
- def setup_class(cls):
- cls.w_s = cls.space.w_str
- cls.w_b = cls.space.w_bool
+ def test_simple(self):
+ assert "{0}".format(True) == "True"
+ assert "{0}".format(False) == "False"
+ assert format(False) == "False"
+ assert format(True) == "True"
- def test_simple(self):
- assert self.s("{0}").format(self.b(True)) == self.s("True")
- assert self.s("{0}").format(self.b(False)) == self.s("False")
- assert format(self.b(False)) == self.s("False")
- assert format(self.b(True)) == self.s("True")
+ def test_with_format(self):
+ assert "{:f}".format(True) == "1.000000"
+ assert "{:05d}".format(False) == "00000"
+ # TODO - add more?
+
class BaseIntegralFormattingTest:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit