Skip to content

Commit

Permalink
fix tests on gitlab runner
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdagger committed Oct 20, 2023
1 parent a6af91a commit 0d6b528
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/core-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,19 @@ jobs:
run: |
pipx install poetry
pipx list --verbose
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache for poetry venv and tools
uses: actions/cache@v3
with:
path: |
./.cache
./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- run: poetry install --without doc
cache: 'poetry'
- run: |
poetry install --without doc
- name: Unit tests with pytest
run: poetry run pytest
run: |
poetry run pytest
- name: Static typechecking with mypy
run: poetry run mypy ./zammadoo
run: |
poetry run mypy ./zammadoo
- name: Static code analysis with pylint
if: ${{ matrix.python-version != '3.8' }}
run: |
poetry run pylint ./zammadoo
7 changes: 6 additions & 1 deletion tests/test_objects.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import sys
from datetime import datetime
from sys import getrefcount
from weakref import getweakrefcount, ref

import pytest
Expand All @@ -27,7 +27,12 @@ def test_client_resource_are_cached_if_referenced(client):
assert tickets1_2 is tickets1_3


@pytest.mark.skipif(
sys.implementation.name == "pypy", reason="pypy has not sys.getrefcount"
)
def test_client_resource_instance_has_weak_reference(client):
from sys import getrefcount

tickets1_1 = client.tickets(1)
assert getrefcount(tickets1_1) == 2
assert getweakrefcount(tickets1_1) == 1
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_representation_of_tags(request, client):

def test_tag_iteration(rclient):
for tag in rclient.tags:
assert tag.keys() == TypedTag.__required_keys__
assert tag.keys() == {"name", "id", "count"}
break


Expand Down

0 comments on commit 0d6b528

Please sign in to comment.