Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove random_module_path in case it exists #122

Open
AlmogBaku opened this issue Jan 26, 2025 · 3 comments
Open

Remove random_module_path in case it exists #122

AlmogBaku opened this issue Jan 26, 2025 · 3 comments

Comments

@AlmogBaku
Copy link

AlmogBaku commented Jan 26, 2025

Stopping/terminating a cell in the middle can cause the file not to be deleted. In this case, we should delete it instead of throwing an error

https://github.com/chmp/ipytest/blame/09b7ff6a1990b88de52da565b86fac7ff63e2f37/ipytest/_impl.py#L425-L426

@chmp
Copy link
Owner

chmp commented Jan 27, 2025

Good point. Never ran into this issue before. Out of interest: is there anything specific you're code is doing?

But looking at the code it seems to be an issue (nice touch using blame btw ;)). Probably it's better though to log a warning and instead use the file as-is. If the file was created deliberately, deleting it could cause all kinds of havoc.

@AlmogBaku
Copy link
Author

im running a long-running tests (LLM evaluations) with https://github.com/AlmogBaku/pytest-evals

it's an open source I wrote that works with your library :)

@AlmogBaku
Copy link
Author

with the recent version(released yesterday) of my project I wrote a new ipython magic that wraps ipytest with a fix for this bug... it seems to work
see https://github.com/AlmogBaku/pytest-evals/blob/master/src/pytest_evals/ipython_extension.py#L42

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

No branches or pull requests

2 participants