Commit 14f1567
committed
fix(test): distinguish an unknown test name from an unknown file
Review feedback on #6061. A `path::test_name` selector that fails
because the file is not a test file and one that fails because the file
has no such test both reported "is not a known model or test file",
which points at the wrong thing in the second case.
The two are now told apart: if the path resolves to a known test file,
the error names the test and the file it looked in. Otherwise the
message is unchanged.
Also adds Python model coverage for path selection, both in isolation
and combined with --local, since selection is by file path and there was
nothing pinning that .py behaves the same as .sql.
Separately, renames a loop variable in _select_tests_by_test_path. It
shadowed a str binding from the branch above with a Path, which mypy
rejects; it was pre-existing on this branch rather than introduced here.
Signed-off-by: Adegbite Ayoade <tripleaceme@gmail.com>1 parent ab4a951 commit 14f1567
3 files changed
Lines changed: 123 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3659 | 3659 | | |
3660 | 3660 | | |
3661 | 3661 | | |
3662 | | - | |
3663 | | - | |
| 3662 | + | |
| 3663 | + | |
3664 | 3664 | | |
3665 | 3665 | | |
3666 | 3666 | | |
3667 | 3667 | | |
3668 | 3668 | | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
3669 | 3685 | | |
3670 | 3686 | | |
3671 | 3687 | | |
| |||
3704 | 3720 | | |
3705 | 3721 | | |
3706 | 3722 | | |
3707 | | - | |
| 3723 | + | |
3708 | 3724 | | |
3709 | 3725 | | |
3710 | 3726 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2820 | 2820 | | |
2821 | 2821 | | |
2822 | 2822 | | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
2697 | 2698 | | |
2698 | 2699 | | |
2699 | 2700 | | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
2700 | 2741 | | |
2701 | 2742 | | |
2702 | 2743 | | |
| |||
2763 | 2804 | | |
2764 | 2805 | | |
2765 | 2806 | | |
2766 | | - | |
| 2807 | + | |
2767 | 2808 | | |
2768 | 2809 | | |
2769 | 2810 | | |
2770 | 2811 | | |
2771 | | - | |
| 2812 | + | |
2772 | 2813 | | |
2773 | 2814 | | |
2774 | 2815 | | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
2775 | 2826 | | |
2776 | 2827 | | |
2777 | 2828 | | |
| |||
0 commit comments