Fix style

This commit is contained in:
Joe Rickerby
2020-06-26 21:41:00 +01:00
parent c956f118f6
commit ad871f886a
2 changed files with 11 additions and 8 deletions
+10 -6
View File
@@ -1,29 +1,33 @@
import pytest
from cibuildwheel.docker_container import DockerContainer
import subprocess
import time
import textwrap
import pytest
from cibuildwheel.docker_container import DockerContainer
DEFAULT_IMAGE = 'centos:6'
@pytest.mark.slow
def test_simple():
with DockerContainer(DEFAULT_IMAGE) as container:
assert container.call(['echo', 'hello'], capture_output=True) == 'hello\n'
@pytest.mark.slow
def test_no_lf():
with DockerContainer(DEFAULT_IMAGE) as container:
assert container.call(['printf', 'hello'], capture_output=True) == 'hello'
@pytest.mark.slow
def test_environment():
with DockerContainer(DEFAULT_IMAGE) as container:
assert container.call(['sh', '-c', 'echo $TEST_VAR'], env={'TEST_VAR': '1'}, capture_output=True) == '1\n'
@pytest.mark.slow
def test_container_removed():
start_time = time.time()
with DockerContainer(DEFAULT_IMAGE) as container:
container.call(['true'])
docker_containers_listing = subprocess.run('docker container ls', shell=True, check=True, capture_output=True, universal_newlines=True).stdout
@@ -33,6 +37,7 @@ def test_container_removed():
docker_containers_listing = subprocess.run('docker container ls', shell=True, check=True, capture_output=True, universal_newlines=True).stdout
assert old_container_name not in docker_containers_listing
@pytest.mark.slow
def test_large_environment():
# max environment variable size is 128kB
@@ -48,6 +53,7 @@ def test_large_environment():
# check the length of d
assert container.call(['sh', '-c', 'echo ${#d}'], env=large_environment, capture_output=True) == f'{long_env_var_length}\n'
@pytest.mark.slow
def test_binary_output():
with DockerContainer(DEFAULT_IMAGE) as container:
@@ -81,5 +87,3 @@ def test_binary_output():
capture_output=True,
)
assert output == binary_data_string