[Python-checkins] Fix typo in test_dataclasses.py (gh-95735) (gh-95740)

ericvsmith webhook-mailer at python.org
Tue Aug 9 07:46:59 EDT 2022


https://github.com/python/cpython/commit/514ec820319138242589f9ca0aa2277de0a1c453
commit: 514ec820319138242589f9ca0aa2277de0a1c453
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ericvsmith <ericvsmith at users.noreply.github.com>
date: 2022-08-09T07:46:20-04:00
summary:

Fix typo in test_dataclasses.py (gh-95735) (gh-95740)

`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 at d-woods.co.uk>

Co-authored-by: da-woods <dw-git at d-woods.co.uk>

files:
M Lib/test/test_dataclasses.py

diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py
index 569f97902a39..63380ea0b680 100644
--- a/Lib/test/test_dataclasses.py
+++ b/Lib/test/test_dataclasses.py
@@ -2215,12 +2215,12 @@ class C(B):
         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):



More information about the Python-checkins mailing list