Commit f9b2b50
simonbreidenbach
Load initial conftest when an option value is an existing file path (#13913)
Since the switch to intermixed argument parsing (115b870), the *value* of a
command line option that is a path to an existing file (e.g.
``--write-idents idents.txt``) ends up among the positional arguments during
pre-parsing. _set_initial_conftests() then treated it as a test path anchor.
Because the anchor was a file, the ``test*`` sub-directory discovery was
skipped, and since the anchor list was non-empty the invocation-directory
fallback was skipped too. As a result a conftest.py that registers the option
(typically living under a ``test*`` directory) was not loaded as an initial
conftest, so the option was reported as "unrecognized".
Resolve file anchors to their containing directory (via _get_directory) so
both the conftest loading and the ``test*`` sub-directory discovery consider
the right location.
Fixes #13913.1 parent efc0134 commit f9b2b50
3 files changed
Lines changed: 40 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
653 | 661 | | |
654 | 662 | | |
655 | | - | |
656 | | - | |
| 663 | + | |
657 | 664 | | |
658 | 665 | | |
659 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
465 | 495 | | |
466 | 496 | | |
467 | 497 | | |
| |||
0 commit comments