Commit 07a560f
committed
Fix collection error when tests is specified with --doctest-modules
The problem was that _matchnodes would receive two items: [DoctestModule, Module]. It would then collect the first one, *cache it*, and fail to match against the name in the command line. Next, it would reuse the cached item (DoctestModule) instead of collecting the Module which would eventually find the "test" name on it.
Added the type of the node to the cache key to avoid this problem, although I'm not a big fan of caches that have different key types.
Fix #38431 parent f1079a8 commit 07a560f
File tree
3 files changed
+15
-3
lines changed- changelog
- src/_pytest
- testing
3 files changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
628 | | - | |
629 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
630 | 631 | | |
631 | 632 | | |
632 | | - | |
| 633 | + | |
633 | 634 | | |
634 | 635 | | |
635 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
663 | 673 | | |
664 | 674 | | |
665 | 675 | | |
| |||
0 commit comments