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:
66 self .expected_type : Type [object ] = expected_type
77
88 def __repr__ (self ) -> str :
9- return "Any ({self.expected_type.__name__})"
9+ return f"ANY ({ self .expected_type .__name__ } )"
1010
1111 def __eq__ (self , other : Any ) -> bool :
1212 return isinstance (other , self .expected_type )
Original file line number Diff line number Diff line change 11import os
22from pathlib import Path
33
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)"
517
618
719def test_is_tmp_dir (tmp_dir : TmpDir ) -> None :
You can’t perform that action at this time.
0 commit comments