MCPcopy
hub / github.com/mne-tools/mne-python / pytest_runtest_call

Function pytest_runtest_call

mne/conftest.py:1172–1188  ·  view source on GitHub ↗

Run notebook code written in Python.

(item)

Source from the content-addressed store, hash-verified

1170
1171
1172def pytest_runtest_call(item):
1173 """Run notebook code written in Python."""
1174 if "nbexec" in getattr(item, "fixturenames", ()):
1175 nbexec = item.funcargs["nbexec"]
1176 code = inspect.getsource(getattr(item.module, item.name.split("[")[0]))
1177 code = code.splitlines()
1178 ci = 0
1179 for ci, c in enumerate(code):
1180 if c.startswith(" "): # actual content
1181 break
1182 code = "\n".join(code[ci:])
1183
1184 def run(nbexec=nbexec, code=code):
1185 nbexec(code)
1186
1187 item.runtest = run
1188 return
1189
1190
1191@pytest.fixture(

Callers

nothing calls this directly

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected