Best Python code snippet using autotest_python
test_setup_dirs.py
Source:test_setup_dirs.py
...8sys.argv = [abspath(__file__), '--help']9from setup import NAME # goatools10from setup import PACKAGES # modules in goatools11from tests.utils import REPO12def test_setup_dirs():13 """Test that all GOATOOLS package dirs are in the setup.py file"""14 pkgs_setup = set(m for m in PACKAGES if 'test_' not in m)15 pkgs_dirs = _get_pkgmods()16 assert pkgs_dirs.issubset(pkgs_setup), _errmsg(pkgs_setup, pkgs_dirs)17 print('**NOTE: TEST PASSED')18def _errmsg(pkgs_setup, pkgs_dirs):19 """Print the packages which are not found in setup.py"""20 len_name = len(NAME) + 121 missing = set(m[len_name:] for m in pkgs_dirs.difference(pkgs_setup))22 return '**FATAL: MISSING PACKAGES in setup.py:\n NAME + ".{P}",'.format(23 P='",\n NAME + ".'.join(sorted(missing)))24def _get_pkgmods():25 """Get the GOATOOLS package modules by walking the package dirs"""26 pkgs = set()27 len_repo = len(REPO) + 128 for root, _, _ in walk(join(REPO, NAME)):29 if root[-11:] != '__pycache__':30 pkg = root[len_repo:].replace('/', '.')31 if 'test_' not in pkg:32 pkgs.add(pkg)33 return pkgs34if __name__ == '__main__':...
test_config.py
Source:test_config.py
...3def test_get():4 config_path = "./chipsnet/config/train_beam.yaml"5 conf = config.get(config_path)6 assert conf.task == "train"7def test_setup_dirs():8 config_path = "./chipsnet/config/train_beam.yaml"9 conf = config.get(config_path)10 config.setup_dirs(conf, False)...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!