def test_get_tox_ini_python_versions_no_tox_envlist(tmp_path): tox_ini = tmp_path / "tox.ini" tox_ini.write_text( textwrap.dedent("""\ [tox] minversion = 3.4.0 """)) assert get_tox_ini_python_versions(tox_ini) == []
def test_get_tox_ini_python_versions_no_tox_section(tmp_path): tox_ini = tmp_path / "tox.ini" tox_ini.write_text( textwrap.dedent("""\ [flake8] source = foo """)) assert get_tox_ini_python_versions(tox_ini) == []
def test_get_tox_ini_python_versions(tmp_path): tox_ini = tmp_path / "tox.ini" tox_ini.write_text( textwrap.dedent("""\ [tox] envlist = py27,py36,py27-docs """)) assert get_tox_ini_python_versions(tox_ini) == ['2.7', '3.6']
def test_get_tox_ini_python_versions_syntax_error(tmp_path): tox_ini = tmp_path / "tox.ini" tox_ini.write_text(textwrap.dedent("""\ ... """)) assert get_tox_ini_python_versions(tox_ini) == []