1
- import sys
2
1
import subprocess
3
- import virtualenv
2
+ import sys
3
+
4
4
import pytest
5
5
6
+ import virtualenv
7
+
6
8
VIRTUALENV_SCRIPT = virtualenv .__file__
7
9
10
+
8
11
def test_commandline_basic (tmpdir ):
9
12
"""Simple command line usage should work"""
10
- subprocess .check_call ([
11
- sys .executable ,
12
- VIRTUALENV_SCRIPT ,
13
- str (tmpdir .join ('venv' ))
14
- ])
13
+ subprocess .check_call ([sys .executable , VIRTUALENV_SCRIPT , str (tmpdir .join ("venv" ))])
14
+
15
15
16
16
def test_commandline_explicit_interp (tmpdir ):
17
17
"""Specifying the Python interpreter should work"""
18
- subprocess .check_call ([
19
- sys .executable ,
20
- VIRTUALENV_SCRIPT ,
21
- '-p' , sys .executable ,
22
- str (tmpdir .join ('venv' ))
23
- ])
18
+ subprocess .check_call ([sys .executable , VIRTUALENV_SCRIPT , "-p" , sys .executable , str (tmpdir .join ("venv" ))])
19
+
24
20
25
21
# The registry lookups to support the abbreviated "-p 3.5" form of specifying
26
22
# a Python interpreter on Windows don't seem to work with Python 3.5. The
@@ -30,15 +26,9 @@ def test_commandline_explicit_interp(tmpdir):
30
26
@pytest .mark .skipif ("sys.platform == 'win32' and sys.version_info[:1] >= (3,)" )
31
27
def test_commandline_abbrev_interp (tmpdir ):
32
28
"""Specifying abbreviated forms of the Python interpreter should work"""
33
- if sys .platform == ' win32' :
34
- fmt = ' %s.%s'
29
+ if sys .platform == " win32" :
30
+ fmt = " %s.%s"
35
31
else :
36
- fmt = ' python%s.%s'
32
+ fmt = " python%s.%s"
37
33
abbrev = fmt % (sys .version_info [0 ], sys .version_info [1 ])
38
- subprocess .check_call ([
39
- sys .executable ,
40
- VIRTUALENV_SCRIPT ,
41
- '-p' , abbrev ,
42
- str (tmpdir .join ('venv' ))
43
- ])
44
-
34
+ subprocess .check_call ([sys .executable , VIRTUALENV_SCRIPT , "-p" , abbrev , str (tmpdir .join ("venv" ))])
0 commit comments