File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ def __init__(self, expected_type: Type[object]) -> None:
6
6
self .expected_type : Type [object ] = expected_type
7
7
8
8
def __repr__ (self ) -> str :
9
- return "Any ({self.expected_type.__name__})"
9
+ return f"ANY ({ self .expected_type .__name__ } )"
10
10
11
11
def __eq__ (self , other : Any ) -> bool :
12
12
return isinstance (other , self .expected_type )
Original file line number Diff line number Diff line change 1
1
import os
2
2
from pathlib import Path
3
3
4
- from pytest_test_utils import TmpDir
4
+ import pytest
5
+
6
+ from pytest_test_utils import ANY , TmpDir
7
+
8
+
9
+ def test_any () -> None :
10
+ assert ANY (str ) == "5"
11
+ assert ANY (str ) != 5
12
+
13
+ with pytest .raises (AssertionError ):
14
+ assert ANY (int ) != 5
15
+ assert ANY (int ) == 5
16
+ assert repr (ANY (int )) == "ANY(int)"
5
17
6
18
7
19
def test_is_tmp_dir (tmp_dir : TmpDir ) -> None :
You can’t perform that action at this time.
0 commit comments