Skip to content

Commit 28761c8

Browse files
committed
Have AssertionRewritingHook derive from importlib.abc.MetaPathFinder
This is nice for self-documentation, and is the type required by mypy for adding to sys.meta_path.
1 parent 0f11a7a commit 28761c8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/_pytest/assertion/rewrite.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import ast
33
import errno
44
import functools
5+
import importlib.abc
56
import importlib.machinery
67
import importlib.util
78
import io
@@ -37,7 +38,7 @@
3738
AST_NONE = ast.NameConstant(None)
3839

3940

40-
class AssertionRewritingHook:
41+
class AssertionRewritingHook(importlib.abc.MetaPathFinder):
4142
"""PEP302/PEP451 import hook which rewrites asserts."""
4243

4344
def __init__(self, config):

0 commit comments

Comments
 (0)