aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2021-02-23Add deletedoccache alias to the clear cache commandGravatar Numerlor-1/+1
2021-02-23cleanup->clean_upGravatar Numerlor-2/+2
2021-02-23Remove unnecessary commentsGravatar Numerlor-10/+0
The comments explain things that should be clear, or basic concepts
2021-02-23Use "inventories" when referring to the cog's collection of sphinx invsGravatar Numerlor-9/+9
Previously in some context inventory referred both to a single "inventory" that we got from a remote objects.inv and to the internal cog inventories. Always referring to the cog's inventories as plural The update_single docstring was also changed from rebuild to build, as the method doesn't handle anything with a preexisting inventory with the same symbols being in the cog's inventories
2021-02-23Simplify conditionGravatar Numerlor-1/+1
2021-02-23Simplify the _split_parameters implementationGravatar Numerlor-30/+18
The main simplification was getting rid of keeping track of string depth which was unnecessary, as we can just always skip them as was being done for strings inside of brackets. The branching was also simplified to make sure less unnecessary checks were being done with a bit less confusing elifs.
2021-02-23Fix docstring typosGravatar Numerlor-10/+10
2021-02-05Remove unnecessary use of partialGravatar Numerlor-6/+4
run_in_executor can provide args to the func it's passed in, making the use of partial unnecessary. This will also make it more convenient to move to asyncio.to_thread when the codebase is switched to python 3.9
2021-02-03Avoid from import on _batch_parserGravatar Numerlor-3/+2
The tests import the modules the other way around causing a circular import
2021-02-03Use create_task utilGravatar Numerlor-2/+3
2021-02-03Create a task for setting the redis result instead of awaitingGravatar Numerlor-1/+1
The queue parsing doesn't depend on anything with redis, so the await only delays the result being set on the future.
2021-02-03Move BeautifulSoup parsing into an executorGravatar Numerlor-1/+4
2021-02-03Remove url lockGravatar Numerlor-3/+1
The items are added to the futures dict before a context switch can occur, making the subsequent requests to the url skip the queue extend and suspend at the future await
2021-02-03Use more consistent naming for doc items and symbolsGravatar Numerlor-71/+71
Trailing commas were also added where missing
2021-02-03Import module directly to avoid circular dependency and use of typeGravatar Numerlor-13/+11
2021-02-02Attempt to resolve first part of the argument in case of a failed lookupGravatar Numerlor-2/+12
2021-01-30Require a set of names to ignore instead of a blanket ignoringGravatar Numerlor-16/+16
As work is done on the modules the wrapper and wrapped functions are in more conflicts can occur, previously this could be missed as the info log that was done in case the error was suppressed was done when modules were being initialized during which there is a logging spam.
2021-01-23Cancel current task inside coro to not keep track of attempts manuallyGravatar Numerlor-8/+5
The scheduler shields the coroutine from cancellation so we can cancel the scheduler's tasks inside of it to avoid the error from multiple tasks with the same id trying to be scheduled which the manual tracking of attempts solved Co-authored-by: MarkKoz <[email protected]>
2021-01-23Wrap whole string in shortenGravatar Numerlor-1/+1
This helps avoid subtracting the length of "Moved: " from the shorten index Co-authored-by: MarkKoz <[email protected]>
2021-01-23Avoid errors when the first element is longer than the truncation indexGravatar Numerlor-3/+10
2021-01-23lock markdownify version to 0.6.1Gravatar Numerlor-5/+5
the 0.6.3 update brought a change that fails to ignore newlines in the html, introducing unnecessary lines into the output
2021-01-23Create a namespace varGravatar Numerlor-8/+9
2021-01-23Properly handle cache being clearedGravatar Numerlor-13/+16
Previously the code deleted the entry of all of the DocItems of the page after its contents were requested once, but this caused problems when the cache was cleared when it expired. Instead of deleting the entry to check if it should be queued on the next item request, we keep it and create an entry in the _item_futures dict for all items again and check for containment there. To avoid populating the queue multiple times with the same item in some cases the futures cleanup task will now only run when the queue is empty
2021-01-22Fix issues with multiple gets being suspended when a refresh startsGravatar Numerlor-6/+34
With a normal event, if multiple gets were suspended and a refresh started, we'd continue the refresh after the first get finished and set the event which would be the same behaviour as the one it tried to fix. This is avoided by using a counter that's incremented every time a context manager is entered around an event and only setting the event when that counter reaches a zero after everything exited the context mgr
2021-01-22Use the SVG badge on the READMEGravatar Matteo Bertucci-1/+1
2021-01-22Update badges on the README fileGravatar Matteo Bertucci-4/+3
2021-01-21Fix aliases of shadow tempbanGravatar Joe Banks-1/+1
2021-01-21Added slowmode tracking to dpy and ot0Gravatar Boris Muratov-2/+12
2021-01-21Use inspect.unwrap instead of manually unwrappingGravatar Numerlor-3/+1
2021-01-21Changed slowmode reset testsGravatar mbaruh-12/+4
2021-01-21Added slowmode stat for python-general.Gravatar mbaruh-4/+8
2021-01-21Slowmode reset now uses slowmode setGravatar mbaruh-10/+1
2021-01-20Prevent bot from sending DMs to itselfGravatar Joe Banks-0/+4
Fixes BOT-KX
2021-01-19Remove additional embed messageGravatar Boris Muratov-9/+1
2021-01-19Replace in_whitelist check with commands.has_any_role checkGravatar ks129-2/+1
in_whitelist allow normal users also run commands in bot commands, but branding commands should be mod+ only, so we need to use has_any_role instead from discord.py.
2021-01-18Sync: test chunking of user requestsGravatar MarkKoz-11/+18
2021-01-18Sync: chunk user requestsGravatar MarkKoz-2/+8
The site can't handle huge syncs. Even a bulk patch of 10k users will crash the service. Chunk the requests into groups of 1000 users and await them sequentially. Testing showed that concurrent requests are not scalable and would also crash the service.
2021-01-18Update config-default.ymlGravatar Boris Muratov-0/+4
Whitelisted mod_meta and mod_tools as mod channels
2021-01-17Stop Tag Matching On SuggestionGravatar Hassan Abouelela-6/+1
2021-01-17Checks If Similar Command Is NoneGravatar Hassan Abouelela-0/+3
2021-01-17Adds Return On Tag MatchesGravatar Hassan Abouelela-4/+9
2021-01-17Update to use Member.pending instead of bot.http.get_memberGravatar Joe Banks-3/+1
2021-01-16Removed 'Channels' import, unused.Gravatar xithrius-1/+1
2021-01-16Relock PipfileGravatar Karlis S-17/+7
2021-01-16Add startup and daemon tasks canceling on cog unloadGravatar ks129-0/+6
2021-01-16Remove unwatch reason from the !nominate outputGravatar Matteo Bertucci-2/+1
As the watch reason can contain private information, we shouldn't share it with the whole staff.
2021-01-15Use a defaultdict for item futuresGravatar Numerlor-2/+2
To be able to set the attribute at the start of the coro we need to be able to access the item's future before we know about all the other items. This also saves us from having to add them all as the queue parser or get_markdown will create the futures for us dynamically
2021-01-14Prevent an inventory refresh while waiting for item cacheGravatar Numerlor-0/+7
If an inventory refresh was started while the symbol embed coroutine was suspended, it could cause the parser to try to fetch a non existent future if the markdown was requested after it was cleared but before new inventories were loaded in.
2021-01-14Raise an error or log a warning if there's a global name conflictGravatar Numerlor-5/+35
When wrapper uses a global name, which conflicts with a global name from wrapped's module that wrapped uses for its annotations, we run into a situation that can't be solved without changing one of the names, so an error is raised to give this clearer meaning. The check may be erroneous in some edge cases or the objects the conflicting names refer to can be functionally identical, so the error can be turned into a logged warning.
2021-01-14Ensure footer is actually max 100 charsGravatar Numerlor-2/+3
Shortening the renamed symbols string to 100 chars is not accurate as the footer also contains a string before that, subtracting its length fixes this.