Updated test_env_yml.py file
MODIFY
tests/test_env_yml.py
tests/test_env_yml.py
@@ -6,18 +6,20 @@ import sys
import pytest
from repo2docker import buildpacks
-#@pytest.mark.xfail(reason="Not yet implemented")
+
def test_empty_env_yml(tmpdir):
tmpdir.chdir()
p = tmpdir.join("environment.yml")
+ p.write("")
bp = buildpacks.CondaBuildPack()
- with pytest.raises(Exception):
- py_ver = bp.python_version()
+ py_ver = bp.python_version
+ # If the environment.yml is empty python_version will get an empty string
+ assert py_ver == ''
def test_no_dict_env_yml(tmpdir):
tmpdir.chdir()
q = tmpdir.join("environment.yml")
q.write("list/n ,string")
bq = buildpacks.CondaBuildPack()
- with pytest.raises(Exception):
- py_ver = bq.python_version()
\ No newline at end of file
+ with pytest.raises(TypeError):
+ py_ver = bq.python_version
\ No newline at end of file

Updated test_env_yml.py file