Skip to content

Pass config to pytest_report_teststatus in the nbdime reporter - #234

Open
julian-belina wants to merge 1 commit into
computationalmodelling:masterfrom
julian-belina:fix-nbdime-reporter-config
Open

julian-belina wants to merge 1 commit into
computationalmodelling:masterfrom
julian-belina:fix-nbdime-reporter-config

Conversation

@julian-belina

Copy link
Copy Markdown

NbdimeReporter.pytest_runtest_logreport calls the pytest_report_teststatus hook without its config argument. pytest 9 has a built-in implementation of this hook (in _pytest/subtests.py) that takes config, so pluggy raises an error and a run with --nbdime stops:

INTERNALERROR> pluggy._result.HookCallError: hook call must provide argument 'config'

This is why test_nbdime fails on AppVeyor for Python 3.10–3.12, which get pytest 9.2. Python 3.9 gets pytest 8.4 and passes. This PR passes config=self.config, which the hook specification has included for all pytest versions that nbval supports.

With pytest 9.2 on Windows, test_nbdime fails before this change and passes after it.

🤖 Generated with Claude Code

pytest 9 has a built-in pytest_report_teststatus implementation (in
_pytest/subtests.py) that takes config. NbdimeReporter calls the hook
without it, so pluggy raises

    HookCallError: hook call must provide argument 'config'

and a run with --nbdime ends with an internal error. This is why
test_nbdime fails with pytest 9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant