Skip to content

feat(levels): add levels leaderboard #406

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented May 19, 2025

Description

This PR changes the following:

  • Adds levels/ranking system for both discord and reddit
  • Migrates existing levels from mee6 for discord
  • For discord xp between 15 and 25 will awarded for each minute that a user is messaging
  • For reddit xp between 150 and 250 will be awarded for every minute that a user creates or comments on a submission
  • Adds a rank slash command
  • Adds a leaderboard slash command

TODO:

  • Discord leaderboard slash command to support reddit users
  • Specify channel to send Discord level up message to
  • Determine if new slash commands should be added to reddit (reddit cogs?)
  • Use new Database.query wherever tinydb.Query is used
  • Possibly, allow paging through leaderboard
  • Record new betamax cassettes/fixtures
  • Unit testing and coverage

Screenshot

image

image

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Copy link

codecov bot commented May 19, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
52 4 48 0
View the top 3 failed test(s) by shortest run time
tests/unit/reddit/test_reddit_bot.py::TestBot::test_comment_loop
Stack Traces | 0.024s run time
Traceback (most recent call last):
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 341, in from_call
    result: TResult | None = func()
                             ^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 242, in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/threadexception.py", line 92, in pytest_runtest_call
    yield from thread_exception_runtest_hook()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/unraisableexception.py", line 95, in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/logging.py", line 846, in pytest_runtest_call
    yield from self._runtest_for(item, "call")
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/logging.py", line 829, in _runtest_for
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/_pytest/capture.py", line 898, in pytest_runtest_call
    return (yield)
            ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/_pytest/skipping.py", line 257, in pytest_runtest_call
    return (yield)
            ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 174, in pytest_runtest_call
    item.runtest()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/python.py", line 1627, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/python.py", line 159, in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../unit/reddit/test_reddit_bot.py", line 205, in test_comment_loop
    comment = bot._comment_loop(test=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../src/reddit_bot/bot.py", line 387, in _comment_loop
    self.process_comment(comment=comment)
  File ".../src/reddit_bot/bot.py", line 155, in process_comment
    comments_table.insert(comment_data)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 163, in insert
    doc_id = self._get_next_id()
             ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 679, in _get_next_id
    table = self._read_table()
            ^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 708, in _read_table
    tables = self._storage.read()
             ^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/tinydb/middlewares.py", line 99, in read
    self.cache = self.storage.read()
                 ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/tinydb/storages.py", line 124, in read
    self._handle.seek(0, os.SEEK_END)
ValueError: I/O operation on closed file.
tests/unit/reddit/test_reddit_bot.py::TestBot::test_process_comment
Stack Traces | 0.026s run time
Traceback (most recent call last):
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 341, in from_call
    result: TResult | None = func()
                             ^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 242, in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/threadexception.py", line 92, in pytest_runtest_call
    yield from thread_exception_runtest_hook()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/unraisableexception.py", line 95, in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/logging.py", line 846, in pytest_runtest_call
    yield from self._runtest_for(item, "call")
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/logging.py", line 829, in _runtest_for
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/_pytest/capture.py", line 898, in pytest_runtest_call
    return (yield)
            ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/_pytest/skipping.py", line 257, in pytest_runtest_call
    return (yield)
            ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 174, in pytest_runtest_call
    item.runtest()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/python.py", line 1627, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/python.py", line 159, in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../unit/reddit/test_reddit_bot.py", line 174, in test_process_comment
    bot.process_comment(comment=slash_command_comment)
  File ".../src/reddit_bot/bot.py", line 155, in process_comment
    comments_table.insert(comment_data)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 163, in insert
    doc_id = self._get_next_id()
             ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 679, in _get_next_id
    table = self._read_table()
            ^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 708, in _read_table
    tables = self._storage.read()
             ^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/tinydb/middlewares.py", line 99, in read
    self.cache = self.storage.read()
                 ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/tinydb/storages.py", line 124, in read
    self._handle.seek(0, os.SEEK_END)
ValueError: I/O operation on closed file.
tests/unit/reddit/test_reddit_bot.py::TestBot::test_process_submission
Stack Traces | 0.221s run time
Traceback (most recent call last):
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 341, in from_call
    result: TResult | None = func()
                             ^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 242, in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/threadexception.py", line 92, in pytest_runtest_call
    yield from thread_exception_runtest_hook()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/unraisableexception.py", line 95, in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/logging.py", line 846, in pytest_runtest_call
    yield from self._runtest_for(item, "call")
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/logging.py", line 829, in _runtest_for
    yield
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/_pytest/capture.py", line 898, in pytest_runtest_call
    return (yield)
            ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/_pytest/skipping.py", line 257, in pytest_runtest_call
    return (yield)
            ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/_pytest/runner.py", line 174, in pytest_runtest_call
    item.runtest()
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/python.py", line 1627, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12............................................./site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12....../site-packages/_pytest/python.py", line 159, in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../unit/reddit/test_reddit_bot.py", line 190, in test_process_submission
    bot.process_submission(submission=_submission)
  File ".../src/reddit_bot/bot.py", line 212, in process_submission
    submissions_table.insert(submission_data)
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 163, in insert
    doc_id = self._get_next_id()
             ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 679, in _get_next_id
    table = self._read_table()
            ^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12........./site-packages/tinydb/table.py", line 708, in _read_table
    tables = self._storage.read()
             ^^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/tinydb/middlewares.py", line 99, in read
    self.cache = self.storage.read()
                 ^^^^^^^^^^^^^^^^^^^
  File ".../hostedtoolcache/Python/3.12.10...................................................................................................................../x64/lib/python3.12.../site-packages/tinydb/storages.py", line 124, in read
    self._handle.seek(0, os.SEEK_END)
ValueError: I/O operation on closed file.

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@ReenigneArcher ReenigneArcher force-pushed the feat/levels/add-levels-leaderboard branch 24 times, most recently from b57bfbc to 8780c06 Compare May 23, 2025 01:48
@ReenigneArcher ReenigneArcher force-pushed the feat/levels/add-levels-leaderboard branch from 8780c06 to 984396a Compare May 23, 2025 20:33
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 New issues
3 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

Successfully merging this pull request may close these issues.

Migrate mee6 functionality
1 participant