Update the TypeError message and example in the unit test.
MODIFY
repo2docker/buildpacks/conda/__init__.py
repo2docker/buildpacks/conda/__init__.py
@@ -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

MODIFY
tests/test_env_yml.py
tests/test_env_yml.py
@@ -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
\ No newline at end of file

Update the TypeError message and example in the unit test.