jazzband/django-constance

@override_config decorator RuntimeWarning wih async test

Opened this issue · 0 comments

ton77v commented

Describe the problem

Following the example from documentation that works just fine with sync functions I’ve tried applying it to the async one, the test is passed but RuntimeWarning pops up.

Steps to reproduce

@override_config(YOUR_QUEST="To find the Holy Grail")  # replace 'YOUR_QUEST' with an actual key from config
    async def test_what_is_your_quest(self):
        self.assertEqual(config.YOUR_QUEST, "To find the Holy Grail")

..PATH\unittest\case.py:579: RuntimeWarning: coroutine 'class_name.test_what_is_your_quest' was never awaited
if method() is not None:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

System configuration

  • Django version: 4.2.1
  • Python version: 3.11.3
  • Django-Constance version: 2.9.1