summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-08-08 20:17:45 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-08-08 20:17:45 (GMT)
commit955d2b2168464da17b4e3f534ae5b3814970f7e9 (patch)
tree5594681139ef735a93dfc59cd551318a833e8eef /Lib/test/test_decimal.py
parent0955f29703fed81b9bf47a91314e615454496f67 (diff)
downloadcpython-955d2b2168464da17b4e3f534ae5b3814970f7e9.zip
cpython-955d2b2168464da17b4e3f534ae5b3814970f7e9.tar.gz
cpython-955d2b2168464da17b4e3f534ae5b3814970f7e9.tar.bz2
Add a test for Context.copy().
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 0a23808..a32caed 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1056,6 +1056,14 @@ class ContextAPItests(unittest.TestCase):
self.assert_(Decimal(10) in ['a', 1.0, Decimal(10), (1,2), {}])
self.assert_(Decimal(10) not in ['a', 1.0, (1,2), {}])
+ def test_copy(self):
+ # All copies should be deep
+ c = Context()
+ d = c.copy()
+ self.assertNotEqual(id(c), id(d))
+ self.assertNotEqual(id(c.flags), id(d.flags))
+ self.assertNotEqual(id(c.traps), id(d.traps))
+
def test_main(arith=False, verbose=None):
""" Execute the tests.