Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@override_config decorator RuntimeWarning wih async test #522

Open
ton77v opened this issue Jun 2, 2023 · 0 comments
Open

@override_config decorator RuntimeWarning wih async test #522

ton77v opened this issue Jun 2, 2023 · 0 comments

Comments

@ton77v
Copy link

ton77v commented Jun 2, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant