changes in test
This commit is contained in:
@@ -38,9 +38,6 @@ unittest:
|
|||||||
qodana:
|
qodana:
|
||||||
stage: 'code_quality'
|
stage: 'code_quality'
|
||||||
needs: ['gemnasium-python-dependency_scanning', 'semgrep-sast', 'kics-iac-sast']
|
needs: ['gemnasium-python-dependency_scanning', 'semgrep-sast', 'kics-iac-sast']
|
||||||
only:
|
|
||||||
- master
|
|
||||||
- merge_requests
|
|
||||||
image:
|
image:
|
||||||
name: jetbrains/qodana-python-community
|
name: jetbrains/qodana-python-community
|
||||||
entrypoint:
|
entrypoint:
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import disnake
|
|||||||
from disnake import OptionChoice
|
from disnake import OptionChoice
|
||||||
from disnake.ext import commands
|
from disnake.ext import commands
|
||||||
|
|
||||||
from bot.lib import logger
|
from bot.lib.Comands import write_json
|
||||||
from bot.lib import write_json
|
from bot.lib.Logger import logger
|
||||||
|
|
||||||
|
|
||||||
class Fun(commands.Cog, name='Fun'):
|
class Fun(commands.Cog, name='Fun'):
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from disnake import Option
|
|||||||
from disnake.ext import commands
|
from disnake.ext import commands
|
||||||
|
|
||||||
from bot.lib import YandexPlayer
|
from bot.lib import YandexPlayer
|
||||||
from bot.lib import logger
|
from bot.lib.Logger import logger
|
||||||
|
|
||||||
|
|
||||||
class Testing(commands.Cog, name='Testing'):
|
class Testing(commands.Cog, name='Testing'):
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
import os
|
import tracemalloc
|
||||||
import sys
|
|
||||||
|
tracemalloc.start()
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from disnake.ext.commands.common_bot_base import CommonBotBase
|
from disnake.ext.commands.common_bot_base import CommonBotBase
|
||||||
from mock import mock
|
from mock import mock
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
|
|
||||||
from bot.lib.CogsPrep import cog_list, work_with_cogs
|
from bot.lib.CogsPrep import cog_list, work_with_cogs
|
||||||
@@ -31,3 +35,11 @@ async def test_work_with_cogs(what_do, cog):
|
|||||||
assert mock_bot.unload_extension.called
|
assert mock_bot.unload_extension.called
|
||||||
elif what_do == 'reload':
|
elif what_do == 'reload':
|
||||||
assert mock_bot.reload_extension.called
|
assert mock_bot.reload_extension.called
|
||||||
|
|
||||||
|
|
||||||
|
snapshot = tracemalloc.take_snapshot()
|
||||||
|
top_stats = snapshot.statistics('lineno')
|
||||||
|
|
||||||
|
print("[ Top 10 ]")
|
||||||
|
for stat in top_stats[:10]:
|
||||||
|
print(stat)
|
||||||
|
|||||||
Reference in New Issue
Block a user