-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestsample.py
More file actions
25 lines (22 loc) · 772 Bytes
/
testsample.py
File metadata and controls
25 lines (22 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import pytest
import requests
@pytest.fixture
def update_result_todb(request):
print('In update_result_toDB')
def _fin():
try:
print(request.node.rep_call.passed)
if(request.node.rep_call.passed):
print('Result updated to DB successfully')
else:
print('test failed')
except:
print ('exception raised')
request.addfinalizer(_fin)
return _fin
def test_failure(update_result_todb):
print('test_failure')
assert 1 == 0
def test_success(update_result_todb):
print('test_success')
assert 0 == 0