MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / pytest_configure

Function pytest_configure

lib/sqlalchemy/testing/plugin/pytestplugin.py:84–119  ·  view source on GitHub ↗
(config: pytest.Config)

Source from the content-addressed store, hash-verified

82
83
84def pytest_configure(config: pytest.Config):
85 plugin_base.read_config(config.rootpath)
86 if plugin_base.exclude_tags or plugin_base.include_tags:
87 new_expr = " and ".join(
88 list(plugin_base.include_tags)
89 + [f"not {tag}" for tag in plugin_base.exclude_tags]
90 )
91
92 if config.option.markexpr:
93 config.option.markexpr += f" and {new_expr}"
94 else:
95 config.option.markexpr = new_expr
96
97 if config.pluginmanager.hasplugin("xdist"):
98 config.pluginmanager.register(XDistHooks())
99
100 if hasattr(config, "workerinput"):
101 plugin_base.restore_important_follower_config(config.workerinput)
102 plugin_base.configure_follower(config.workerinput["follower_ident"])
103 else:
104 if config.option.write_idents and os.path.exists(
105 config.option.write_idents
106 ):
107 os.remove(config.option.write_idents)
108
109 plugin_base.pre_begin(config.option)
110
111 plugin_base.set_coverage_flag(
112 bool(getattr(config.option, "cov_source", False))
113 )
114
115 plugin_base.set_fixture_functions(PytestFixtureFunctions)
116
117 if config.option.dump_pyannotate:
118 global DUMP_PYANNOTATE
119 DUMP_PYANNOTATE = True
120
121
122DUMP_PYANNOTATE = False

Callers

nothing calls this directly

Calls 5

XDistHooksClass · 0.85
joinMethod · 0.45
registerMethod · 0.45
existsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected