diff --git a/_pytest/assertion/__init__.py b/_pytest/assertion/__init__.py index c1c8f3be1..5c63be76a 100644 --- a/_pytest/assertion/__init__.py +++ b/_pytest/assertion/__init__.py @@ -65,7 +65,7 @@ def pytest_pycollect_before_module_import(mod): if rewrite_asserts is None: return # Some deep magic: load the source, rewrite the asserts, and write a - # fake pyc, so that it'll be loaded further down this function. + # fake pyc, so that it'll be loaded when the module is imported. source = mod.fspath.read() try: tree = ast.parse(source)