Add redbot.core.app_commands namespace (#6006)

This commit is contained in:
Jakub Kuczys
2023-03-28 02:49:59 +02:00
committed by GitHub
parent c79d0d723e
commit 44e129bc66
8 changed files with 104 additions and 21 deletions

View File

@@ -0,0 +1,23 @@
import inspect
import pytest
from discord import app_commands as dpy_app_commands
from redbot.core import app_commands
def test_dpy_app_commands_reexports():
dpy_attrs = set()
for attr_name, attr_value in dpy_app_commands.__dict__.items():
if attr_name.startswith("_") or inspect.ismodule(attr_value):
continue
dpy_attrs.add(attr_name)
missing_attrs = dpy_attrs - set(app_commands.__dict__.keys())
if missing_attrs:
pytest.fail(
"redbot.core.app_commands is missing these names from discord.app_commands: "
+ ", ".join(missing_attrs)
)

View File

@@ -50,15 +50,6 @@ def test_dpy_commands_reexports():
dpy_attrs.add(attr_name)
missing_attrs = dpy_attrs - set(commands.__dict__.keys())
# temporarily ignore things related to app commands as the work on that is done separately
missing_attrs -= {
"GroupCog",
"HybridGroup",
"hybrid_group",
"hybrid_command",
"HybridCommand",
"HybridCommandError",
}
if missing_attrs:
pytest.fail(