Remove final --pyargs call, and now-unnecessary call to modules instead of local files, since that's fixed by certbot's code being one layer deeper

This commit is contained in:
Erica Portnoy 2019-11-18 18:51:12 -08:00
parent 44f128e560
commit 7f951071dc
2 changed files with 6 additions and 13 deletions

View file

@ -9,17 +9,15 @@ from __future__ import print_function
import os
import sys
import tempfile
import shutil
import subprocess
import re
SKIP_PROJECTS_ON_WINDOWS = ['certbot-apache', 'letshelp-certbot']
def call_with_print(command, cwd=None):
def call_with_print(command):
print(command)
subprocess.check_call(command, shell=True, cwd=cwd or os.getcwd())
subprocess.check_call(command, shell=True)
def main(args):
@ -41,13 +39,8 @@ def main(args):
call_with_print(' '.join(current_command))
pkg = re.sub(r'\[\w+\]', '', requirement)
temp_cwd = tempfile.mkdtemp()
shutil.copy2("pytest.ini", temp_cwd)
try:
call_with_print(' '.join([
sys.executable, '-m', 'pytest', '--pyargs', pkg.replace('-', '_')]), cwd=temp_cwd)
finally:
shutil.rmtree(temp_cwd)
call_with_print(' '.join([
sys.executable, '-m', 'pytest', pkg]))
if __name__ == '__main__':
main(sys.argv[1:])

View file

@ -69,9 +69,9 @@ def merge_requirements(tools_path, requirements, test_constraints, all_constrain
fd.write(merged_requirements)
def call_with_print(command, cwd=None):
def call_with_print(command):
print(command)
subprocess.check_call(command, shell=True, cwd=cwd or os.getcwd())
subprocess.check_call(command, shell=True)
def pip_install_with_print(args_str):