~ibmcharmers/charms/xenial/ibm-cinder-storwize-svc/trunk

« back to all changes in this revision

Viewing changes to .tox/py35/lib/python3.5/site-packages/_pytest/setupplan.py

  • Committer: Ankammarao
  • Date: 2017-03-06 05:11:42 UTC
  • Revision ID: achittet@in.ibm.com-20170306051142-dpg27z4es1k56hfn
Marked tests folder executable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import pytest
 
2
 
 
3
 
 
4
def pytest_addoption(parser):
 
5
    group = parser.getgroup("debugconfig")
 
6
    group.addoption('--setupplan', '--setup-plan', action="store_true",
 
7
                    help="show what fixtures and tests would be executed but "
 
8
                    "don't execute anything.")
 
9
 
 
10
 
 
11
@pytest.hookimpl(tryfirst=True)
 
12
def pytest_fixture_setup(fixturedef, request):
 
13
    # Will return a dummy fixture if the setuponly option is provided.
 
14
    if request.config.option.setupplan:
 
15
        fixturedef.cached_result = (None, None, None)
 
16
        return fixturedef.cached_result
 
17
 
 
18
 
 
19
@pytest.hookimpl(tryfirst=True)
 
20
def pytest_cmdline_main(config):
 
21
    if config.option.setupplan:
 
22
        config.option.setuponly = True
 
23
        config.option.setupshow = True