Add cwd argument to DockerContainer

This commit is contained in:
Yannick Jadoul
2020-07-20 18:07:45 +02:00
parent 2b7da3fcbe
commit 29b0cdb08a
2 changed files with 11 additions and 1 deletions
+7
View File
@@ -41,6 +41,13 @@ def test_environment():
assert container.call(['sh', '-c', 'echo $TEST_VAR'], env={'TEST_VAR': '1'}, capture_output=True) == '1\n'
@pytest.mark.docker
def test_cwd():
with DockerContainer(DEFAULT_IMAGE, cwd='/cibuildwheel/working_directory') as container:
assert container.call(['pwd'], capture_output=True) == '/cibuildwheel/working_directory\n'
assert container.call(['pwd'], capture_output=True, cwd='/opt') == '/opt\n'
@pytest.mark.docker
def test_container_removed():
with DockerContainer(DEFAULT_IMAGE) as container: