diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-03-02 20:39:07 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-03-02 20:39:07 -0500 |
| commit | ae522f08e6bbb86bb4f3e2036c6f85ea37a770f5 (patch) | |
| tree | 86536f422ba6896fa48822e9a2aaaacaa91990cf /lib | |
| parent | 746789942521a3cc0bd9b80ceda08c9a414802ca (diff) | |
| download | sqlalchemy-ae522f08e6bbb86bb4f3e2036c6f85ea37a770f5.tar.gz | |
that seems to work
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sqlalchemy/testing/plugin/pytestplugin.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/testing/plugin/pytestplugin.py b/lib/sqlalchemy/testing/plugin/pytestplugin.py index 8ad941f6b..943ef6a66 100644 --- a/lib/sqlalchemy/testing/plugin/pytestplugin.py +++ b/lib/sqlalchemy/testing/plugin/pytestplugin.py @@ -63,8 +63,11 @@ def pytest_runtest_setup(item): # ... so we're doing a little dance here to figure it out... if item.parent is not _current_class: + class_setup(item.parent) _current_class = item.parent + item.parent.addfinalizer(lambda: class_teardown(item.parent)) + test_setup(item) def pytest_runtest_teardown(item, nextitem): @@ -73,8 +76,6 @@ def pytest_runtest_teardown(item, nextitem): test_teardown(item) - if nextitem is None or nextitem.parent is not _current_class: - class_teardown(item.parent) def test_setup(item): id_ = "%s.%s:%s" % (item.parent.module.__name__, item.parent.name, item.name) @@ -90,5 +91,4 @@ def class_setup(item): pytest.skip(gs.message) def class_teardown(item): - # TODO: not working yet, this has to be called *after* test teardown/teardown_class plugin_base.stop_test_class(item.cls) |
