diff --git a/.coveragerc b/.coveragerc index e9011ae0..75e2803b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,7 @@ [run] branch = True +concurrency = multiprocessing +parallel = true source = . omit = src/spellbot/_version.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b6edc6d..51d9aa32 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,33 +75,31 @@ jobs: - name: Checkout Source uses: actions/checkout@v3 + - name: Install Poetry + id: install-poetry + run: pipx install poetry + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'poetry' - - name: Install Dependencies - run: | - git --version - python --version - python -m pip install --upgrade pip - pip --version - pip install poetry - poetry --version - poetry install + - name: Install Packages + run: poetry install - name: Run Tests - run: | - poetry run pytest -n auto -vv --cov --cov-report=html --cov-report=xml + run: poetry run pytest -n auto -vv --cov --cov-report=html --cov-report=xml env: DATABASE_URL: ${{ matrix.database-url }} - name: Send Reports to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 env: PYTHON: ${{ matrix.python-version }} POSTGRES: ${{ matrix.postgres-version }} DB_URL: ${{ matrix.database-url }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: env_vars: PYTHON,POSTGRES,DB_URL diff --git a/poetry.lock b/poetry.lock index 09d55985..79332510 100644 --- a/poetry.lock +++ b/poetry.lock @@ -749,13 +749,13 @@ doc = ["Sphinx", "sphinx-rtd-theme", "sphinxcontrib-spelling"] [[package]] name = "faker" -version = "25.0.0" +version = "25.0.1" description = "Faker is a Python package that generates fake data for you." optional = false python-versions = ">=3.8" files = [ - {file = "Faker-25.0.0-py3-none-any.whl", hash = "sha256:e23a2b74888885c3d23a9237bacb823041291c03d609a39acb9ebe6c123f3986"}, - {file = "Faker-25.0.0.tar.gz", hash = "sha256:87ef41e24b39a5be66ecd874af86f77eebd26782a2681200e86c5326340a95d3"}, + {file = "Faker-25.0.1-py3-none-any.whl", hash = "sha256:6737cc6d591cd83421fdc5e494f6e2c1a6e32266214f158b745aa9fa15687c98"}, + {file = "Faker-25.0.1.tar.gz", hash = "sha256:c153505618801f1704807b258a6010ea8cabf91f66f4788939bfdba83b887e76"}, ] [package.dependencies] diff --git a/pyproject.toml b/pyproject.toml index 96e4b6cd..17c47b10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -112,7 +112,7 @@ safe_licenses = [ [tool.pytest.ini_options] addopts = """ - -W ignore::DeprecationWarning --no-header --cov --cov-report=html -vv + -W ignore::DeprecationWarning --no-header --cov --cov-append --cov-report xml:coverage.xml --cov-report=html -vv """ [tool.poetry] @@ -210,4 +210,4 @@ virtualenv = "^20" [build-system] build-backend = "poetry.core.masonry.api" -requires = ["poetry-core>=1.0.8"] +requires = ["poetry-core>=1.9.0"] diff --git a/tests/models/test_user.py b/tests/models/test_user.py index 62ef8cc5..dfae76d6 100644 --- a/tests/models/test_user.py +++ b/tests/models/test_user.py @@ -47,6 +47,13 @@ def test_user(self, factories: Factories) -> None: assert player1.points(game2.id) == (play1.points, False) assert player2.points(game2.id) == (play2.points, False) + def test_pending_games(self, factories: Factories) -> None: + guild = factories.guild.create() + channel = factories.channel.create(guild=guild) + game = factories.game.create(guild=guild, channel=channel) + user = factories.user.create(game=game) + assert user.pending_games() == 1 + class TestModelUserWaiting: def test_happy_path(self, factories: Factories) -> None: