File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,15 @@ class Error(Exception):
22 pass
33
44
5- class FileNotFoundError (Error ):
5+ class FileNotFoundError (Error , FileNotFoundError ):
66 pass
77
88
9- class NotAFileError (Error ):
9+ class IsADirectoryError (Error , IsADirectoryError ):
1010 pass
1111
1212
13- class NotADirectoryError (Error ):
13+ class NotADirectoryError (Error , NotADirectoryError ):
1414 pass
1515
1616
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ from dissect .btrfs import exceptions
4+
5+
6+ @pytest .mark .parametrize (
7+ "exc, std" ,
8+ [
9+ (exceptions .FileNotFoundError , FileNotFoundError ),
10+ (exceptions .IsADirectoryError , IsADirectoryError ),
11+ (exceptions .NotADirectoryError , NotADirectoryError ),
12+ ],
13+ )
14+ def test_filesystem_error_subclass (exc : exceptions .Error , std : Exception ) -> None :
15+ assert issubclass (exc , std )
16+ assert isinstance (exc (), std )
17+
18+ with pytest .raises (std ):
19+ raise exc ()
You can’t perform that action at this time.
0 commit comments