1- from datetime import datetime
1+ import datetime
2+ from typing import List
23
34import pytest
45
@@ -17,15 +18,15 @@ class EmptyParserProxy(ParserProxy):
1718def parser_proxy_with_version ():
1819 class ParserProxyWithVersion (ParserProxy ):
1920 class Version (BaseParser ):
20- VALID_UNTIL = datetime .now (). date ()
21+ VALID_UNTIL = datetime .date . today ()
2122
2223 return ParserProxyWithVersion
2324
2425
2526@pytest .fixture
2627def parser_with_static_method ():
2728 class ParserWithStaticMethod (BaseParser ):
28- VALID_UNTIL = datetime .now (). date ()
29+ VALID_UNTIL = datetime .date . today ()
2930
3031 @staticmethod
3132 def test ():
@@ -37,7 +38,7 @@ def test():
3738@pytest .fixture
3839def parser_with_function_test ():
3940 class ParserWithFunctionTest (BaseParser ):
40- VALID_UNTIL = datetime .now (). date ()
41+ VALID_UNTIL = datetime .date . today ()
4142
4243 @function
4344 def test (self ):
@@ -49,7 +50,7 @@ def test(self):
4950@pytest .fixture
5051def parser_with_attr_title ():
5152 class ParserWithAttrTitle (BaseParser ):
52- VALID_UNTIL = datetime .now (). date ()
53+ VALID_UNTIL = datetime .date . today ()
5354
5455 @attribute
5556 def title (self ) -> str :
@@ -62,17 +63,36 @@ def title(self) -> str:
6263def proxy_with_two_versions_and_different_attrs ():
6364 class ProxyWithTwoVersionsAndDifferentAttrs (ParserProxy ):
6465 class Later (BaseParser ):
65- VALID_UNTIL = datetime (2023 , 1 , 2 ). date ( )
66+ VALID_UNTIL = datetime . date (2023 , 1 , 2 )
6667
6768 @attribute
6869 def title (self ) -> str :
6970 return "This is a title"
7071
7172 class Earlier (BaseParser ):
72- VALID_UNTIL = datetime (2023 , 1 , 1 ). date ( )
73+ VALID_UNTIL = datetime . date (2023 , 1 , 1 )
7374
7475 @attribute
7576 def another_title (self ) -> str :
7677 return "This is a another title"
7778
7879 return ProxyWithTwoVersionsAndDifferentAttrs
80+
81+
82+ @pytest .fixture
83+ def proxy_with_two_deprecated_attributes ():
84+ class ProxyWithTwoDeprecatedAttributes (ParserProxy ):
85+ class ParserWithTwoDeprecatedAttributes (BaseParser ):
86+ @attribute
87+ def title (self ) -> str :
88+ return "This is a title"
89+
90+ @attribute (deprecated = datetime .date (2024 , 1 , 1 ))
91+ def topics (self ) -> List [str ]:
92+ return ["This is a topic" ]
93+
94+ @attribute (deprecated = datetime .date (2024 , 4 , 1 ))
95+ def authors (self ) -> List [str ]:
96+ return ["This is a author" ]
97+
98+ return ProxyWithTwoDeprecatedAttributes
0 commit comments