Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions behave_django/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,21 @@ def setup_test(self, context):
This method runs the code necessary to create the test database, start
the live server, etc.
"""
if django.VERSION >= (5, 2):
context.test.__class__._pre_setup(run=True)
else:
context.test._pre_setup(run=True)
context.test.setUpClass()
#if django.VERSION >= (5, 2):
# context.test.__class__._pre_setup(run=True)
#else:
# context.test._pre_setup(run=True)
#context.test.setUpClass()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you comment this out?

context.test()

def teardown_test(self, context):
"""
Tears down the Django test
"""
context.test.tearDownClass()
context.test._post_teardown(run=True)
#context.test.tearDownClass()
#context.test._post_teardown(run=True)
#if context.test.doClassCleanups:
# context.test.doClassCleanups()
Comment on lines +125 to +126
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in behave#164, instead of adding the cleanup code you should probably better make sure addClassCleanup is never executed to create cleanup tasks.

This is typically done by overriding the related class method by an empty implementation (see example).

del context.test


Expand Down
Loading
Loading