def test_path_returns_Path_objects(cleanup_env): env = Env.start({'path': {'a': '/tmp/path/file.txt', 'b': '/another/path/file.csv'}}) assert isinstance(env.path.a, Path) assert isinstance(env.path.b, Path)
def test_can_instantiate_env_if_located_in_sample_subdir(move_to_sample_subdir, cleanup_env): Env.start()
def test_can_create_env_from_dict(cleanup_env): e = Env.start({'a': 1}) assert e.a == 1
def test_version_placeholder(cleanup_env): env = Env.start({'module': 'sample_project', 'version': '{{version}}'}) assert env.version == '0.1dev'
def test_init_with_nonexistent_package(cleanup_env): with pytest.raises(ImportError): Env.start({'module': 'i_do_not_exist'})
def test_init_with_module_key(cleanup_env): env = Env.start({'module': 'sample_project'}) assert env.module == 'sample_project'