]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix typo in test_dataclasses.py (gh-95735) (gh-95740)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 9 Aug 2022 11:46:20 +0000 (04:46 -0700)
committerGitHub <noreply@github.com>
Tue, 9 Aug 2022 11:46:20 +0000 (07:46 -0400)
`dataclass` was called as a function when it was almost certainly intended to be a decorator.
(cherry picked from commit 59e09efe888affe549e9249f188797c1325edecc)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
Lib/test/test_dataclasses.py

index 569f97902a39000b4133fd82e9fe9195af25745e..63380ea0b68067a621aeecb2b077da648006a705 100644 (file)
@@ -2215,12 +2215,12 @@ class TestInit(unittest.TestCase):
         self.assertEqual(c.z, 100)
 
     def test_no_init(self):
-        dataclass(init=False)
+        @dataclass(init=False)
         class C:
             i: int = 0
         self.assertEqual(C().i, 0)
 
-        dataclass(init=False)
+        @dataclass(init=False)
         class C:
             i: int = 2
             def __init__(self):