HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyc
�
���ec@s�dZddlZeje�Zejd��Zejd��ZgZgZd�Z	d�Z
d�Zd�Zd	�Z
d
�ZdS(s�
invent a quick version of pytest autouse fixtures as pytest's unacceptably slow
collection/high memory use in pytest 4.6.11, which is the highest version that
works in py2k.

by "too-slow" we mean the test suite can't even manage to be collected for a
single process in less than 70 seconds or so and memory use seems to be very
high as well.   for two or four workers the job just times out after ten
minutes.

so instead we have invented a very limited form of these fixtures, as our
current use of "autouse" fixtures are limited to those in fixtures.py.

assumptions for these fixtures:

1. we are only using "function" or "class" scope

2. the functions must be associated with a test class

3. the fixture functions cannot themselves use pytest fixtures

4. the fixture functions must use yield, not return

When py2k support is removed and we can stay on a modern pytest version, this
can all be removed.


i����NcCs
tjt�S(N(tcollectionstdefaultdicttset(((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyt<lambda>(tcCs
tjt�S(N(RRR(((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyR+RcCs6|jdkst�t|jj||jf�dS(Ntclasstfunction(RR(tscopetAssertionErrort_py2k_fixture_fn_namest__name__tadd(tfntfixture((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pytadd_fixture2scCs�|jjj}x�tD]�}x�t|D]�\}}t||d�}|r'|j|kr'xl|jD]a}||jkrd|dkr�t||j	|�n$|dkr�t
||j	|�nPqdqdWPq'q'WqWdS(NRR(tparenttobjR	tgetattrtNonetim_funct__mro__t__dict__t_py2k_class_fixturesRt_py2k_function_fixtures(titemt
test_classtnamet
fixture_fnRtmethtsup((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyt"scan_for_fixtures_to_use_for_class7s
cCs�|j}|j|�}tj|�}|r�xT|jD]F}x=|j|d�D])}||�}t|�tj|�qPWq7WndS(N((tclst__new__RtgetRtnextt_py2k_cls_fixture_stacktappend(trequestRtselftfixtures_for_this_classtsup_Rtiter_((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pytrun_class_fixture_setupHs	
cCsBx;tr=tjd�}yt|�Wqtk
r9qXqWdS(Ni����(R#tpopR"t
StopIteration(R%R)((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pytrun_class_fixture_teardownXs	
cCs�|j}|j}tj|�}|r�xZt|j�D]F}x=|j|d�D])}||�}t|�tj|�qPWq7WndS(N((	RtinstanceRR!treversedRR"t_py2k_fn_fixture_stackR$(R%RR&R'R(RR)((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pytrun_fn_fixture_setupas		
cCsBx;tr=tjd�}yt|�Wqtk
r9qXqWdS(Ni����(R0R+R"R,(R%R)((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pytrun_fn_fixture_teardownps	
(t__doc__RRRR	RRR#R0RRR*R-R1R2(((sa/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/testing/plugin/reinvent_fixtures_py2k.pyt<module>"s