def get_cases_from_pytest(group):
    config = _prepareconfig(args=str(""))
    session = Session(config)
    session._fixturemanager = FixtureManager(session)
    ret = [
        i for i in session.perform_collect()
        if group in list(MarkMapping(i.keywords)._mymarks)
    ]
    return ret
def group_in_pytest(group):
    config = _prepareconfig(args=str(""))
    session = Session(config)
    session._fixturemanager = FixtureManager(session)
    l = [
        list(MarkMapping(i.keywords)._mymarks)
        for i in session.perform_collect()
    ]
    groups = set([item for sublist in l for item in sublist])

    return group in groups
Example #3
0
 def test_function_equality(self, testdir, tmpdir):
     from _pytest.python import FixtureManager
     config = testdir.parseconfigure()
     session = testdir.Session(config)
     session._fixturemanager = FixtureManager(session)
     def func1():
         pass
     def func2():
         pass
     f1 = pytest.Function(name="name", parent=session, config=config,
             args=(1,), callobj=func1)
     assert f1 == f1
     f2 = pytest.Function(name="name",config=config,
             callobj=func2, parent=session)
     assert f1 != f2
Example #4
0
def group_in_pytest(group):
    from _pytest.config import _prepareconfig
    from _pytest.main import Session
    from _pytest.python import FixtureManager
    from _pytest.mark import MarkMapping
    config = _prepareconfig(args="")
    session = Session(config)
    session._fixturemanager = FixtureManager(session)
    l = [
        list(MarkMapping(i.keywords)._mymarks)
        for i in session.perform_collect()
    ]
    groups = set([item for sublist in l for item in sublist])

    return group in groups