Update the TypeError message and example in the unit test.

pull/318/head
Gladys Nalvarte 2018-06-04 12:56:20 +02:00
rodzic 63e459664c
commit 43f367c590
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -141,7 +141,7 @@ class CondaBuildPack(BaseImage):
env = {}
# check if the env file has a dictionary not a list or other data structure.
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', []):
if not isinstance(dep, str):
continue

Wyświetl plik

@ -19,7 +19,8 @@ def test_empty_env_yml(tmpdir):
def test_no_dict_env_yml(tmpdir):
tmpdir.chdir()
q = tmpdir.join("environment.yml")
q.write("list/n ,string")
q.write("numpy\n "
"matplotlib\n")
bq = buildpacks.CondaBuildPack()
with pytest.raises(TypeError):
py_ver = bq.python_version