diff options
author | Armin Rigo <arigo@tunes.org> | 2016-09-01 11:03:49 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2016-09-01 11:03:49 +0100 |
commit | dc59b9af732c23caeacac54604df8ed40e8fd247 (patch) | |
tree | 73bf15e36acff93447d9987a3002cc817bc0d960 /_pytest | |
parent | Rename the exception that we call TestException to some class name that (diff) | |
download | pypy-dc59b9af732c23caeacac54604df8ed40e8fd247.tar.gz pypy-dc59b9af732c23caeacac54604df8ed40e8fd247.tar.bz2 pypy-dc59b9af732c23caeacac54604df8ed40e8fd247.zip |
Hack at our included py.test to fail, not quietly skip, when it sees a
TestXxx class with an __init__() method
Diffstat (limited to '_pytest')
-rw-r--r-- | _pytest/python.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/_pytest/python.py b/_pytest/python.py index a882dec70e..42c45f9f42 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -498,7 +498,10 @@ class Class(PyCollector): """ Collector for test methods. """ def collect(self): if hasinit(self.obj): - pytest.skip("class %s.%s with __init__ won't get collected" % ( + # XXX used to be skip(), but silently skipping classes + # XXX just because they have been written long ago is + # XXX imho a very, very, very bad idea + pytest.fail("class %s.%s with __init__ won't get collected" % ( self.obj.__module__, self.obj.__name__, )) |