summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-12 22:47:53 (GMT)
committerGitHub <noreply@github.com>2023-07-12 22:47:53 (GMT)
commit77d9fdf23be4b705b65b08ed00bb5df7988ecf3c (patch)
treecea18bd9a44f2933c44bc795b4ba64eb4f5e9ed7 /Lib/test
parentec7b05a0bebb2cc2ec42bf00cde2b66145880459 (diff)
downloadcpython-77d9fdf23be4b705b65b08ed00bb5df7988ecf3c.zip
cpython-77d9fdf23be4b705b65b08ed00bb5df7988ecf3c.tar.gz
cpython-77d9fdf23be4b705b65b08ed00bb5df7988ecf3c.tar.bz2
[3.12] gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106695)
gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106666) (cherry picked from commit 357e9e9da3929cb9d55ea31896e66f488e44e8f2) Co-authored-by: Prince Roshan <princekrroshan01@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_enum.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 592deb8..dbdc639 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -804,9 +804,17 @@ class _MinimalOutputTests:
TE = self.MainEnum
copied = copy.copy(TE)
self.assertEqual(copied, TE)
+ self.assertIs(copied, TE)
deep = copy.deepcopy(TE)
self.assertEqual(deep, TE)
+ self.assertIs(deep, TE)
+ def test_copy_member(self):
+ TE = self.MainEnum
+ copied = copy.copy(TE.first)
+ self.assertIs(copied, TE.first)
+ deep = copy.deepcopy(TE.first)
+ self.assertIs(deep, TE.first)
class _FlagTests: