MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _tests

Function _tests

noxfile.py:194–323  ·  noxfile.py::_tests
(
    session: nox.Session,
    database: str,
    cext: str = "_auto",
    greenlet: bool = True,
    backendonly: bool = False,
    platform_intensive: bool = False,
    timing_intensive: bool = True,
    coverage: bool = False,
)

Source from the content-addressed store, hash-verified

192
193
194def _tests(
195 session: nox.Session,
196 database: str,
197 cext: str = class="st">"_auto",
198 greenlet: bool = True,
199 backendonly: bool = False,
200 platform_intensive: bool = False,
201 timing_intensive: bool = True,
202 coverage: bool = False,
203) -> None:
204
205 class="cm"># ensure external PYTHONPATH not interfering
206 session.env[class="st">"PYTHONPATH"] = class="st">""
207
208 class="cm"># PYTHONNOUSERSITE - this *MUST* be set so that the ./lib/ import
209 class="cm"># set up explicitly in test/conftest.py is *disabled*, so that
210 class="cm"># when SQLAlchemy is built into the .nox area, we use that and not the
211 class="cm"># local checkout, at least when usedevelop=False
212 session.env[class="st">"PYTHONNOUSERSITE"] = class="st">"1"
213
214 freethreaded = isinstance(session.python, str) and session.python.endswith(
215 class="st">"t"
216 )
217
218 if freethreaded:
219 session.env[class="st">"PYTHON_GIL"] = class="st">"0"
220
221 class="cm"># greenlet frequently crashes with freethreading, so omit
222 class="cm"># for the near future
223 greenlet = False
224
225 session.env[class="st">"SQLALCHEMY_WARN_20"] = class="st">"1"
226
227 if cext == class="st">"cext":
228 session.env[class="st">"REQUIRE_SQLALCHEMY_CEXT"] = class="st">"1"
229 elif cext == class="st">"nocext":
230 session.env[class="st">"DISABLE_SQLALCHEMY_CEXT"] = class="st">"1"
231
232 includes_excludes: dict[str, list[str]] = {class="st">"k": [], class="st">"m": []}
233
234 if coverage:
235 timing_intensive = False
236
237 if platform_intensive:
238 class="cm"># platform_intensive refers to test/aaa_profiling/test_memusage.py.
239 class="cm"># it's only run exclusively of all other tests. does not include
240 class="cm"># greenlet related tests
241 greenlet = False
242 class="cm"># with class="st">"-m memory_intensive", only that suite will run, all
243 class="cm"># other tests will be deselected by pytest
244 includes_excludes[class="st">"m"].append(class="st">"memory_intensive")
245 elif backendonly:
246 class="cm"># with class="st">"-m backendonly", only tests with the backend pytest mark
247 class="cm"># (or pytestplugin equivalent, like __backend__) will be selected
248 class="cm"># by pytest.
249 class="cm"># memory intensive is deselected to prevent these from running
250 includes_excludes[class="st">"m"].extend([class="st">"backend", class="st">"not memory_intensive"])
251 else:

Callers 5

testsFunction · 0.85
coverageFunction · 0.85
github_cext_greenletFunction · 0.85
github_cextFunction · 0.85
github_nocextFunction · 0.85

Calls 12

apply_pytest_optsFunction · 0.90
_setup_for_driverFunction · 0.85
splitMethod · 0.80
unlinkMethod · 0.80
endswithMethod · 0.45
appendMethod · 0.45
extendMethod · 0.45
getMethod · 0.45
runMethod · 0.45
itemsMethod · 0.45
joinMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected