def fixtures( ctx: click.Context, config: str, config_path: Optional[Path], path: Tuple[str], exclude: Tuple[str], fixture_path: Tuple[Path], search: Optional[str], show_scopes: bool, show_docstrings: bool, show_dependencies: bool, show_dependency_trees: bool, full: bool, ): """Show information on fixtures.""" paths = [Path(p) for p in path] mod_infos = get_info_for_modules(paths, exclude) modules = list(load_modules(mod_infos)) tests = list(get_tests_in_modules(modules, capture_output=True)) filtered_fixtures = list( filter_fixtures(_DEFINED_FIXTURES, query=search, paths=fixture_path)) output_fixtures( fixtures=filtered_fixtures, tests=tests, show_scopes=show_scopes or full, show_docstrings=show_docstrings or full, show_dependencies=show_dependencies or full, show_dependency_trees=show_dependency_trees or full, )
def _(path=each(THIS_FILE.parent / "the-fixture-is-not-in-this-file.py")): fixtures = [Fixture(f) for f in [named_fixture]] assert list(filter_fixtures(fixtures, paths=[path])) == []
def _(path=each(THIS_FILE, THIS_FILE.parent, THIS_FILE.parent.parent)): fixtures = [Fixture(f) for f in [named_fixture]] assert list(filter_fixtures(fixtures, paths=[path])) == fixtures
def _(query=each("echo", "foobar", "wizbang")): fixtures = [Fixture(f) for f in [named_fixture, marker_fixture]] assert list(filter_fixtures(fixtures, query=query)) == []
def _(query=each("marker", "mark", "ret", "return", '"')): fixtures = [Fixture(f) for f in [named_fixture, marker_fixture]] assert list(filter_fixtures(fixtures, query=query)) == [Fixture(marker_fixture)]
def _(query=each("test", "test_collect", "collect", "t_coll")): fixtures = [Fixture(f) for f in [named_fixture]] assert list(filter_fixtures(fixtures, query=query)) == fixtures
def _(query=each("named_fixture", "named", "fixture", "med_fix")): fixtures = [Fixture(f) for f in [named_fixture]] assert list(filter_fixtures(fixtures, query=query)) == fixtures
def _(): fixtures = [Fixture(f) for f in [named_fixture, marker_fixture]] assert list(filter_fixtures(fixtures)) == fixtures
def _(): assert list(filter_fixtures([])) == []