@@ -526,7 +526,7 @@ def test_command_substitution_pound(self, tmpdir, newconfig):
526
526
toxworkdir = {toxinidir}/.tox#dir
527
527
528
528
[testenv:py27]
529
- commands = {envpython} {toxworkdir}
529
+ commands = ' {envpython}' ' {toxworkdir}'{/}'foo#bar'
530
530
""" ,
531
531
)
532
532
@@ -541,7 +541,7 @@ def test_command_substitution_pound(self, tmpdir, newconfig):
541
541
542
542
assert envconfig .commands [0 ] == [
543
543
str (envconfig .envbindir .join ("python" )),
544
- str (config .toxworkdir .realpath ( )),
544
+ str (config .toxworkdir .join ( "foo#bar" )),
545
545
]
546
546
547
547
def test_command_substitution_whitespace (self , tmpdir , newconfig ):
@@ -552,7 +552,7 @@ def test_command_substitution_whitespace(self, tmpdir, newconfig):
552
552
toxworkdir = {toxinidir}/.tox dir
553
553
554
554
[testenv:py27]
555
- commands = {envpython} {toxworkdir}
555
+ commands = ' {envpython}' ' {toxworkdir}'{/}'foo bar'
556
556
""" ,
557
557
)
558
558
@@ -567,7 +567,61 @@ def test_command_substitution_whitespace(self, tmpdir, newconfig):
567
567
568
568
assert envconfig .commands [0 ] == [
569
569
str (envconfig .envbindir .join ("python" )),
570
- str (config .toxworkdir .realpath ()),
570
+ str (config .toxworkdir .join ("foo bar" ).realpath ()),
571
+ ]
572
+
573
+ def test_command_env_substitution_pound (self , tmpdir , newconfig ):
574
+ """Ensure pound in path is kept in commands using setenv."""
575
+ config = newconfig (
576
+ """
577
+ [tox]
578
+ toxworkdir = {toxinidir}/.tox#dir
579
+
580
+ [testenv:py27]
581
+ setenv = VAR = '{toxworkdir}'{/}'foo#bar'
582
+ commands = '{envpython}' '{env:VAR}'
583
+ """ ,
584
+ )
585
+
586
+ assert config .toxworkdir .realpath () == tmpdir .join (".tox#dir" ).realpath ()
587
+
588
+ envconfig = config .envconfigs ["py27" ]
589
+
590
+ assert envconfig .envbindir .realpath () in [
591
+ tmpdir .join (".tox#dir" , "py27" , "bin" ).realpath (),
592
+ tmpdir .join (".tox#dir" , "py27" , "Scripts" ).realpath (),
593
+ ]
594
+
595
+ assert envconfig .commands [0 ] == [
596
+ str (envconfig .envbindir .join ("python" )),
597
+ str (config .toxworkdir .join ("foo#bar" ).realpath ()),
598
+ ]
599
+
600
+ def test_command_env_substitution_whitespace (self , tmpdir , newconfig ):
601
+ """Ensure spaces in path is kept in commands using setenv."""
602
+ config = newconfig (
603
+ """
604
+ [tox]
605
+ toxworkdir = {toxinidir}/.tox dir
606
+
607
+ [testenv:py27]
608
+ setenv = VAR = '{toxworkdir}'{/}'foo bar'
609
+ commands = '{envpython}' '{env:VAR}'
610
+ """ ,
611
+ )
612
+
613
+ assert config .toxworkdir .realpath () == tmpdir .join (".tox dir" ).realpath ()
614
+
615
+ envconfig = config .envconfigs ["py27" ]
616
+
617
+ assert envconfig .envbindir .realpath () in [
618
+ tmpdir .join (".tox dir" , "py27" , "bin" ).realpath (),
619
+ tmpdir .join (".tox dir" , "py27" , "Scripts" ).realpath (),
620
+ ]
621
+
622
+ assert envconfig .commands [0 ] == [
623
+ str (envconfig .envbindir .join ("python" )),
624
+ str (config .toxworkdir .join ("foo bar" ).realpath ()),
571
625
]
572
626
573
627
0 commit comments