def test_report_protocol(newconfig): config = newconfig( [], """ [testenv:mypython] deps=xy """, ) class Popen: def __init__(self, *args, **kwargs): pass def communicate(self): return "", "" def wait(self): pass session = Session(config, popen=Popen, Report=ReportExpectMock) report = session.report report.expect("using") venv = session.getvenv("mypython") venv.update() report.expect("logpopen")
def test_getvenv(self, initproj, capfd): initproj("logexample123-0.5", filedefs={ 'tests': {'test_hello.py': "def test_hello(): pass"}, 'tox.ini': ''' [testenv:hello] [testenv:world] ''' }) config = parseconfig([]) session = Session(config) venv1 = session.getvenv("hello") venv2 = session.getvenv("hello") assert venv1 is venv2 venv1 = session.getvenv("world") venv2 = session.getvenv("world") assert venv1 is venv2 pytest.raises(LookupError, lambda: session.getvenv("qwe"))
def test_getvenv(self, initproj, capfd): initproj( "logexample123-0.5", filedefs={ "tests": {"test_hello.py": "def test_hello(): pass"}, "tox.ini": """ [testenv:hello] [testenv:world] """, }, ) config = parseconfig([]) session = Session(config) venv1 = session.getvenv("hello") venv2 = session.getvenv("hello") assert venv1 is venv2 venv1 = session.getvenv("world") venv2 = session.getvenv("world") assert venv1 is venv2 pytest.raises(LookupError, lambda: session.getvenv("qwe"))
def test_report_protocol(newconfig): config = newconfig([], """ [testenv:mypython] deps=xy """) class Popen: def __init__(self, *args, **kwargs): pass def communicate(self): return "", "" def wait(self): pass session = Session(config, popen=Popen, Report=ReportExpectMock) report = session.report report.expect("using") venv = session.getvenv("mypython") venv.update() report.expect("logpopen")