mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Don't use metaclasses when class decorators can do the job.
Thanks to Nick Coghlan for pointing out that I'd forgotten about class decorators.
This commit is contained in:
parent
8e0ed333b9
commit
1be413e366
6 changed files with 63 additions and 64 deletions
|
|
@ -6,9 +6,11 @@ import email
|
|||
import email.message
|
||||
from email import policy
|
||||
from email.headerregistry import HeaderRegistry
|
||||
from test.test_email import TestEmailBase, Parameterized
|
||||
from test.test_email import TestEmailBase, parameterize
|
||||
|
||||
class TestPickleCopyHeader(TestEmailBase, metaclass=Parameterized):
|
||||
|
||||
@parameterize
|
||||
class TestPickleCopyHeader(TestEmailBase):
|
||||
|
||||
header_factory = HeaderRegistry()
|
||||
|
||||
|
|
@ -33,7 +35,8 @@ class TestPickleCopyHeader(TestEmailBase, metaclass=Parameterized):
|
|||
self.assertEqual(str(h), str(header))
|
||||
|
||||
|
||||
class TestPickleCopyMessage(TestEmailBase, metaclass=Parameterized):
|
||||
@parameterize
|
||||
class TestPickleCopyMessage(TestEmailBase):
|
||||
|
||||
# Message objects are a sequence, so we have to make them a one-tuple in
|
||||
# msg_params so they get passed to the parameterized test method as a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue