--- you can reply above this line ---
New issue 220: setup_class was not set correctly as class level
https://bitbucket.org/hpk42/pytest/issue/220/setup_class-was-not-set-correctly-as-class
Anonymous:
#test_d.py source: setup_class was called for each test cases, while teardown
was called once
import pytest
import imp, sys, subprocess
class TestD:
@classmethod
def setup_class(cls):
print 1/0
def test_ssl_exchange_cert(self):
assert 1==1
def test_verify(self):
assert 1==1
@classmethod
def teardown_class(cls):
print 1/0
#########################################
#Output from console
#########################################
============================= test session starts ==============================
platform linux2 -- Python 2.7.3 -- pytest-2.2.4
collecting ... collected 2 items
test_d.py EEE
==================================== ERRORS ====================================
________________ ERROR at setup of TestD.test_ssl_exchange_cert ________________
cls = <class test_d.TestD at 0x8738fbc>
@classmethod
def setup_class(cls):
> print 1/0
E ZeroDivisionError: integer division or modulo by zero
test_d.py:8: ZeroDivisionError
_____________________ ERROR at setup of TestD.test_verify ______________________
cls = <class test_d.TestD at 0x8738fbc>
@classmethod
def setup_class(cls):
> print 1/0
E ZeroDivisionError: integer division or modulo by zero
test_d.py:8: ZeroDivisionError
____________________ ERROR at teardown of TestD.test_verify ____________________
cls = <class test_d.TestD at 0x8738fbc>
@classmethod
def teardown_class(cls):
> print 1/0
E ZeroDivisionError: integer division or modulo by zero
test_d.py:21: ZeroDivisionError
=========================== 3 error in 0.02 seconds ============================
--
This is an issue notification from bitbucket.org. You are receiving
this either because you are the owner of the issue, or you are
following the issue.
_______________________________________________
py-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/py-dev