How to use venv_filter_project method in tox

Best Python code snippet using tox_python

test_session.py

Source:test_session.py Github

copy

Full Screen

...83 )84 result = cmd("--notest")85 result.assert_success()86@pytest.fixture()87def venv_filter_project(initproj, cmd):88 def func(*args):89 initproj(90 "pkg123-0.7",91 filedefs={92 "tox.ini": """93 [tox]94 envlist = {py27,py36}-{nocov,cov,diffcov}{,-extra}95 skipsdist = true96 [testenv]97 skip_install = true98 commands = python -c 'print("{envname}")'99 """,100 },101 )102 result = cmd(*args)103 result.assert_success(is_run_test_env=False)104 active = [i.name for i in result.session.existing_venvs.values()]105 return active, result106 yield func107def test_venv_filter_empty_all_active(venv_filter_project, monkeypatch):108 monkeypatch.delenv("TOX_SKIP_ENV", raising=False)109 active, result = venv_filter_project("-a")110 assert result.outlines == [111 "py27-nocov",112 "py27-nocov-extra",113 "py27-cov",114 "py27-cov-extra",115 "py27-diffcov",116 "py27-diffcov-extra",117 "py36-nocov",118 "py36-nocov-extra",119 "py36-cov",120 "py36-cov-extra",121 "py36-diffcov",122 "py36-diffcov-extra",123 ]124 assert active == result.outlines125def test_venv_filter_match_all_none_active(venv_filter_project, monkeypatch):126 monkeypatch.setenv("TOX_SKIP_ENV", ".*")127 active, result = venv_filter_project("-a")128 assert not active129 existing_envs = result.outlines130 _, result = venv_filter_project("-avv")131 for name in existing_envs:132 msg = "skip environment {}, matches filter '.*'".format(name)133 assert msg in result.outlines134def test_venv_filter_match_some_some_active(venv_filter_project, monkeypatch):135 monkeypatch.setenv("TOX_SKIP_ENV", "py27.*")136 active, result = venv_filter_project("-avvv")137 assert active == [138 "py36-nocov",139 "py36-nocov-extra",140 "py36-cov",141 "py36-cov-extra",142 "py36-diffcov",143 "py36-diffcov-extra",144 ]145@pytest.fixture()146def popen_env_test(initproj, cmd, monkeypatch):147 def func(tox_env, isolated_build):148 files = {149 "tox.ini": """150 [tox]...

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