Skip to content

Commit fbbd112

Browse files
author
renzon
committed
Alterada conexão para escopo de módulo
1 parent c172a8c commit fbbd112

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

libpythonpro/spam/db.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
from time import sleep
2+
3+
14
class Sessao:
25
contador = 0
36
usuarios = []
@@ -18,6 +21,9 @@ def fechar(self):
1821

1922

2023
class Conexao:
24+
def __init__(self):
25+
sleep(10)
26+
2127
def gerar_sessao(self):
2228
return Sessao()
2329

libpythonpro/tests/test_spam/test_usuarios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from libpythonpro.spam.modelos import Usuario
55

66

7-
@pytest.fixture
7+
@pytest.fixture(scope='session')
88
def conexao():
99
# Setup
1010
conexao_obj = Conexao()

0 commit comments

Comments
 (0)