kopia lustrzana https://github.com/jupyterhub/repo2docker
Update the TypeError message and example in the unit test.
rodzic
63e459664c
commit
43f367c590
|
@ -141,7 +141,7 @@ class CondaBuildPack(BaseImage):
|
||||||
env = {}
|
env = {}
|
||||||
# check if the env file has a dictionary not a list or other data structure.
|
# check if the env file has a dictionary not a list or other data structure.
|
||||||
if not isinstance(env, dict):
|
if not isinstance(env, dict):
|
||||||
raise TypeError("environment.yml should contain a dictionary. Got %r" % env)
|
raise TypeError("environment.yml should contain a dictionary. Got %r" % type(env))
|
||||||
for dep in env.get('dependencies', []):
|
for dep in env.get('dependencies', []):
|
||||||
if not isinstance(dep, str):
|
if not isinstance(dep, str):
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -19,7 +19,8 @@ def test_empty_env_yml(tmpdir):
|
||||||
def test_no_dict_env_yml(tmpdir):
|
def test_no_dict_env_yml(tmpdir):
|
||||||
tmpdir.chdir()
|
tmpdir.chdir()
|
||||||
q = tmpdir.join("environment.yml")
|
q = tmpdir.join("environment.yml")
|
||||||
q.write("list/n ,string")
|
q.write("numpy\n "
|
||||||
|
"matplotlib\n")
|
||||||
bq = buildpacks.CondaBuildPack()
|
bq = buildpacks.CondaBuildPack()
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
py_ver = bq.python_version
|
py_ver = bq.python_version
|
Ładowanie…
Reference in New Issue