Open ddouglas87 opened 5 days ago
A temporary fix for this problem is to disable the importnb pytest plugin until it is fixed. This comment explains how. I chose to add the setting into my pyproject.toml file at the root of my project directory. Here's what my pyproject.toml file looks like:
[tool.pytest.ini_options]
addopts = [
"--capture=no",
"--log-cli-level=10",
"-p no:importnb",
]
The capture=no and log level are so print statements can be seen while running a test. The "-p no:importnb",
line fixes the issue.
thanks for trying importnb
and raising this issue. i think a solution is make testing notebook with importnb
not the default and then dealing with the duplicate tests.
as a user, i feel like you would want to opt into the testing. is this what you'd expect?
Also, it doesn't work with the current version from github:
are you saying the current code isn't discovering the tests.
When I
pip install importnb
individual pytests run twice.This is quite weird behavior, because importing importnb isn't required. All you have to do is pip install it and tests start running twice. When uninstalling importnb the issue goes away.
To reproduce:
Note: I've tested this with Python 3.11, 3.12, and 3.13. I've also tested it with pytest 8.3 and 8.2. This is reproducible both in PyCharm and in the command line.
Also, it doesn't work with the current version from github: