python-behave を使用しているときに問題が発生しました。
すべてのシナリオの前にサンドボックス データベースを作成し、シナリオの後に破棄します。
ただし、メモリ使用量はシナリオごとに約 20MB 増加し、合計使用量はすべてのテスト ケースで約 3.xGB です(LoL)。
私の質問は、context.runner.teardown_databases() を呼び出したときにメモリが解放されないのはなぜですか?
from django.test.runner import DiscoverRunner
def before_scenario(context, scenario):
context.runner = DiscoverRunner()
context.runner.setup_test_environment()
context.old_db_config = context.runner.setup_databases()
def after_scenario(context, scenario):
context.runner.teardown_databases(context.old_db_config)
context.runner.teardown_test_environment()
Feature:
Scenario:
Given I have a debit card
When I withdraw 200
Then I should get $200 in cash
@given('I have a debit card')
def step1(context):
pass
@given('I withdraw 200')
def step2(context):
pass
@given('I should get $200 in cash')
def step3(context):
pass
python-behave:バージョン 1.2.5
ジャンゴ: バージョン 1.8.0
Python:バージョン 2.7
どんな提案でも大歓迎です。