How to use toml_file_check method in tox

Best Python code snippet using tox_python

test_package_builder_isolated.py

Source:test_package_builder_isolated.py Github

copy

Full Screen

...55 )56 result = cmd("--sdistonly", "-e", "py")57 result.assert_fail()58 assert result.outlines == ["ERROR: missing {}".format(py.path.local().join("pyproject.toml"))]59def toml_file_check(initproj, version, message, toml):60 initproj(61 "package_toml-{}".format(version),62 filedefs={63 "tox.ini": """64 [tox]65 isolated_build = true66 """,67 "pyproject.toml": toml,68 },69 )70 with pytest.raises(SystemExit, match="1"):71 get_build_info(py.path.local())72 toml_file = py.path.local().join("pyproject.toml")73 msg = "ERROR: {} inside {}".format(message, toml_file)74 assert _INSTANCE.messages == [msg]75def test_package_isolated_toml_no_build_system(initproj):76 toml_file_check(initproj, 1, "build-system section missing", "")77def test_package_isolated_toml_no_requires(initproj):78 toml_file_check(79 initproj,80 2,81 "missing requires key at build-system section",82 """83 [build-system]84 """,85 )86def test_package_isolated_toml_no_backend(initproj):87 toml_file_check(88 initproj,89 3,90 "missing build-backend key at build-system section",91 """92 [build-system]93 requires = []94 """,95 )96def test_package_isolated_toml_bad_requires(initproj):97 toml_file_check(98 initproj,99 4,100 "requires key at build-system section must be a list of string",101 """102 [build-system]103 requires = ""104 build-backend = ""105 """,106 )107def test_package_isolated_toml_bad_backend(initproj):108 toml_file_check(109 initproj,110 5,111 "build-backend key at build-system section must be a string",112 """113 [build-system]114 requires = []115 build-backend = []116 """,117 )118def test_package_isolated_toml_bad_backend_path(initproj):119 """Verify that a non-list 'backend-path' is forbidden."""120 toml_file_check(121 initproj,122 6,123 "backend-path key at build-system section must be a list, if specified",124 """125 [build-system]126 requires = []127 build-backend = 'setuptools.build_meta'128 backend-path = 42129 """,130 )131def test_package_isolated_toml_backend_path_outside_root(initproj):132 """Verify that a 'backend-path' outside the project root is forbidden."""133 toml_file_check(134 initproj,135 6,136 "backend-path must exist in the project root",137 """138 [build-system]139 requires = []140 build-backend = 'setuptools.build_meta'141 backend-path = ['..']142 """,143 )144def test_verbose_isolated_build_in_tree(initproj, mock_venv, cmd):145 initproj(146 "example123-0.5",147 filedefs={...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tox automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful