-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/datascience-notebook
- Loading branch information
Showing
3 changed files
with
61 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,59 @@ | ||
import pytest | ||
import subprocess | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter_git(container): | ||
assert container.status == "created" | ||
assert container.run("make --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_container_has_poetry(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_can_use_poetry_in_container(container, tmp_path): | ||
d = tmp_path / "pyproject.toml" | ||
d.parent.rmdir() | ||
d.parent.mkdir() | ||
d.touch() | ||
d.write_text(PYPROJECT_CONTENT) | ||
# create valid pyproject.toml in container | ||
assert container.status == "created" | ||
subprocess.run(["docker", "cp", str(d), f"{container.id}:/home/testuser/pyproject.toml"]) | ||
print(container.run("ls -la").output) | ||
assert container.run("poetry install").exit_code == 0 | ||
|
||
|
||
PYPROJECT_CONTENT = """ | ||
[tool.poetry] | ||
name = "jovyan" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["jakob"] | ||
readme = "README.md" | ||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
ramda = "^0.7.6" | ||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
""" | ||
import pytest | ||
import subprocess | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter_git(container): | ||
assert container.status == "created" | ||
assert container.run("make --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_container_has_poetry(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_can_use_poetry_in_container(container, tmp_path): | ||
d = tmp_path / "pyproject.toml" | ||
d.parent.rmdir() | ||
d.parent.mkdir() | ||
d.touch() | ||
d.write_text(PYPROJECT_CONTENT) | ||
# create valid pyproject.toml in container | ||
assert container.status == "created" | ||
subprocess.run(["docker", "cp", str(d), f"{container.id}:/home/testuser/pyproject.toml"]) | ||
print(container.run("ls -la").output) | ||
assert container.run("poetry install").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_can_pyodbc_in_container(container): | ||
assert container.status == "created" | ||
assert container.run("echo 'import pyodbc' | python").exit_code == 0 | ||
|
||
|
||
PYPROJECT_CONTENT = """ | ||
[tool.poetry] | ||
name = "jovyan" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["jakob"] | ||
readme = "README.md" | ||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
ramda = "^0.7.6" | ||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
""" |