Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.10/site-packages/astroid/brain/brain_sqlalchemy.py: 88%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

1# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html 

2# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE 

3# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt 

4 

5from astroid import nodes 

6from astroid.brain.helpers import register_module_extender 

7from astroid.builder import parse 

8from astroid.manager import AstroidManager 

9 

10 

11def _session_transform() -> nodes.Module: 

12 return parse( 

13 """ 

14 from sqlalchemy.orm.session import Session 

15 

16 class sessionmaker: 

17 def __init__( 

18 self, 

19 bind=None, 

20 class_=Session, 

21 autoflush=True, 

22 autocommit=False, 

23 expire_on_commit=True, 

24 info=None, 

25 **kw 

26 ): 

27 return 

28 

29 def __call__(self, **local_kw): 

30 return Session() 

31 

32 def configure(self, **new_kw): 

33 return 

34 

35 return Session() 

36 """ 

37 ) 

38 

39 

40def register(manager: AstroidManager) -> None: 

41 register_module_extender(manager, "sqlalchemy.orm.session", _session_transform)