@@ -2711,7 +2711,12 @@ fn cookiecutter_globbing() -> Result<()> {
2711
2711
// The absolute path of the glob contains the glob metacharacters `{{` and `}}` even though the
2712
2712
// user's glob does not.
2713
2713
let tempdir = TempDir :: new ( ) ?;
2714
- let cookiecutter = tempdir. path ( ) . join ( "{{cookiecutter.repo_name}}" ) ;
2714
+ // add an extra layer here to prevent the regex escapes on `{` from conflicting with the tempdir
2715
+ // filter for insta
2716
+ let cookiecutter = tempdir
2717
+ . path ( )
2718
+ . join ( "tmp" )
2719
+ . join ( "{{cookiecutter.repo_name}}" ) ;
2715
2720
let cookiecutter_toml = cookiecutter. join ( "pyproject.toml" ) ;
2716
2721
let tests = cookiecutter. join ( "tests" ) ;
2717
2722
fs:: create_dir_all ( & tests) ?;
@@ -2740,7 +2745,7 @@ fn cookiecutter_globbing() -> Result<()> {
2740
2745
All checks passed!
2741
2746
2742
2747
----- stderr -----
2743
- warning: Error parsing original glob: `"[TMP]/{{cookiecutter.repo_name}}/tests/*"`, trying with escaped braces: `"[TMP]/[{][{]cookiecutter.repo_name[}][}]/tests/*"`
2748
+ warning: Error parsing original glob: `"[TMP]/tmp/ {{cookiecutter.repo_name}}/tests/*"`, trying with escaped braces: `"[TMP]/tmp /[{][{]cookiecutter.repo_name[}][}]/tests/*"`
2744
2749
"# ) ;
2745
2750
} ) ;
2746
2751
@@ -2752,15 +2757,15 @@ fn cookiecutter_globbing() -> Result<()> {
2752
2757
. args( STDIN_BASE_OPTIONS )
2753
2758
. arg( "--select=F811" )
2754
2759
. current_dir( tempdir. path( ) ) , @r"
2755
- success: false
2756
- exit_code: 1
2757
- ----- stdout -----
2758
- {{cookiecutter.repo_name}}/tests/maintest.py:3:8: F811 [*] Redefinition of unused `foo` from line 1
2759
- Found 1 error.
2760
- [*] 1 fixable with the `--fix` option.
2761
-
2762
- ----- stderr -----
2763
- ") ;
2760
+ success: false
2761
+ exit_code: 1
2762
+ ----- stdout -----
2763
+ tmp/ {{cookiecutter.repo_name}}/tests/maintest.py:3:8: F811 [*] Redefinition of unused `foo` from line 1
2764
+ Found 1 error.
2765
+ [*] 1 fixable with the `--fix` option.
2766
+
2767
+ ----- stderr -----
2768
+ ") ;
2764
2769
} ) ;
2765
2770
2766
2771
Ok ( ( ) )
0 commit comments