Skip to content

pytest should not collect notebooks under .ipynb_checkpoints #66

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

danielballan
Copy link
Contributor

Before:

collected 20 items

tutorials/executable/::ipynb_checkpoints/basics-checkpoint::ipynb::Cell 0 PASSED                                         [  5%]
tutorials/executable/::ipynb_checkpoints/basics-checkpoint::ipynb::Cell 1 PASSED                                         [ 10%]
tutorials/executable/::ipynb_checkpoints/basics-checkpoint::ipynb::Cell 2 PASSED                                         [ 15%]
tutorials/executable/::ipynb_checkpoints/basics-checkpoint::ipynb::Cell 3 PASSED                                         [ 20%]
tutorials/executable/::ipynb_checkpoints/basics-checkpoint::ipynb::Cell 4 PASSED                                         [ 25%]
tutorials/executable/::ipynb_checkpoints/basics-checkpoint::ipynb::Cell 5 PASSED                                         [ 30%]
tutorials/executable/basics::ipynb::Cell 0 PASSED                                                                        [ 35%]
tutorials/executable/basics::ipynb::Cell 1 PASSED                                                                        [ 40%]
tutorials/executable/basics::ipynb::Cell 2 PASSED                                                                        [ 45%]
tutorials/executable/basics::ipynb::Cell 3 PASSED                                                                        [ 50%]
tutorials/executable/basics::ipynb::Cell 4 PASSED                                                                        [ 55%]
tutorials/executable/basics::ipynb::Cell 5 PASSED                                                                        [ 60%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 0 PASSED                                                               [ 65%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 1 PASSED                                                               [ 70%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 2 PASSED                                                               [ 75%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 3 PASSED                                                               [ 80%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 4 PASSED                                                               [ 85%]
tutorials/matplotlib/static_mpl::ipynb::Cell 0 PASSED                                                                    [ 90%]
tutorials/matplotlib/static_mpl::ipynb::Cell 1 PASSED                                                                    [ 95%]
tutorials/matplotlib/static_mpl::ipynb::Cell 2 PASSED                                                                    [100%]

After:

collected 20 items / 6 deselected / 14 selected

tutorials/executable/basics::ipynb::Cell 0 PASSED                                                                        [  7%]
tutorials/executable/basics::ipynb::Cell 1 PASSED                                                                        [ 14%]
tutorials/executable/basics::ipynb::Cell 2 PASSED                                                                        [ 21%]
tutorials/executable/basics::ipynb::Cell 3 PASSED                                                                        [ 28%]
tutorials/executable/basics::ipynb::Cell 4 PASSED                                                                        [ 35%]
tutorials/executable/basics::ipynb::Cell 5 PASSED                                                                        [ 42%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 0 PASSED                                                               [ 50%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 1 PASSED                                                               [ 57%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 2 PASSED                                                               [ 64%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 3 PASSED                                                               [ 71%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 4 PASSED                                                               [ 78%]
tutorials/matplotlib/static_mpl::ipynb::Cell 0 PASSED                                                                    [ 85%]
tutorials/matplotlib/static_mpl::ipynb::Cell 1 PASSED                                                                    [ 92%]
tutorials/matplotlib/static_mpl::ipynb::Cell 2 PASSED                                                                    [100%]

@danielballan danielballan requested a review from bsipocz May 16, 2025 14:42
Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into the ini file instead

@danielballan danielballan force-pushed the avoid-ipynb-notebooks branch from ac6a1b6 to b449647 Compare May 16, 2025 15:30
@danielballan
Copy link
Contributor Author

Oh, good point. That's much better. I force-pushed to fix. I confirmed it still works. Also, note that now it only collects 14, rather than collecting 20 and skipping 6.

collected 14 items

tutorials/executable/basics::ipynb::Cell 0 PASSED                                                                        [  7%]
tutorials/executable/basics::ipynb::Cell 1 PASSED                                                                        [ 14%]
tutorials/executable/basics::ipynb::Cell 2 PASSED                                                                        [ 21%]
tutorials/executable/basics::ipynb::Cell 3 PASSED                                                                        [ 28%]
tutorials/executable/basics::ipynb::Cell 4 PASSED                                                                        [ 35%]
tutorials/executable/basics::ipynb::Cell 5 PASSED                                                                        [ 42%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 0 PASSED                                                               [ 50%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 1 PASSED                                                               [ 57%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 2 PASSED                                                               [ 64%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 3 PASSED                                                               [ 71%]
tutorials/matplotlib/interactive_mpl::ipynb::Cell 4 PASSED                                                               [ 78%]
tutorials/matplotlib/static_mpl::ipynb::Cell 0 PASSED                                                                    [ 85%]
tutorials/matplotlib/static_mpl::ipynb::Cell 1 PASSED                                                                    [ 92%]
tutorials/matplotlib/static_mpl::ipynb::Cell 2 PASSED                                                                    [100%]

@bsipocz
Copy link
Member

bsipocz commented May 16, 2025

Yes, I think the correct behaviour is to not collect these at all.

@bsipocz bsipocz merged commit a74d13d into scientific-python:main May 16, 2025
15 checks passed
@danielballan danielballan deleted the avoid-ipynb-notebooks branch May 16, 2025 22:37
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.

2 participants