Skip to content

Commit 24b4995

Browse files
committed
Prepare for e2e testing
1 parent ca93d0c commit 24b4995

File tree

114 files changed

+50
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+50
-13
lines changed

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,13 @@ services:
4141
command: bash -c "ruff check . --select I --fix && ruff format ."
4242
volumes:
4343
- .:/mpt_api_client
44+
45+
e2e:
46+
container_name: mpt_api_client_test
47+
build:
48+
context: .
49+
dockerfile: dev.Dockerfile
50+
working_dir: /mpt_api_client
51+
command: bash -c "pytest -m e2e"
52+
volumes:
53+
- .:/mpt_api_client

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ dev = [
3737
"pytest-deadfixtures==2.2.*",
3838
"pytest-mock==3.14.*",
3939
"pytest-randomly==3.16.*",
40+
"pytest-rerunfailures>=16.1",
4041
"pytest-xdist==3.6.*",
4142
"responses==0.25.*",
4243
"respx==0.22.*",
43-
"ruff==0.12.11", # force ruff version to have same formatting everywhere
44+
"ruff==0.12.11", # force ruff version to have same formatting everywhere
4445
"typing-extensions==4.13.*",
4546
"wemake-python-styleguide==1.3.*",
4647
]
@@ -58,13 +59,16 @@ build-backend = "hatchling.build"
5859
[tool.pytest.ini_options]
5960
testpaths = "tests"
6061
pythonpath = "."
61-
addopts = "--cov=mpt_api_client --cov-report=term-missing --cov-report=html --cov-report=xml --import-mode=importlib"
62+
addopts = "--cov=mpt_api_client --cov-report=term-missing --cov-report=html --cov-report=xml --import-mode=importlib -m 'not e2e'"
6263
log_cli = false
6364
asyncio_mode = "auto"
6465
filterwarnings = [
6566
"ignore:Support for class-based `config` is deprecated:DeprecationWarning",
6667
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
6768
]
69+
markers = [
70+
"e2e: marks tests as e2e"
71+
]
6872

6973
[tool.coverage.run]
7074
branch = true
File renamed without changes.

tests/e2e/test_e2e.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pytest
2+
3+
4+
@pytest.mark.flaky(reruns=5, reruns_delay=2)
5+
@pytest.mark.e2e
6+
def test_example():
7+
import random
8+
assert random.choice([True, False])
File renamed without changes.
File renamed without changes.

tests/http/conftest.py renamed to tests/unit/http/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
CollectionMixin,
1313
ManagedResourceMixin,
1414
)
15-
from tests.conftest import DummyModel
15+
from tests.unit.conftest import DummyModel
1616

1717

1818
class DummyService( # noqa: WPS215

tests/http/test_async_client.py renamed to tests/unit/http/test_async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from mpt_api_client.exceptions import MPTError
88
from mpt_api_client.http.async_client import AsyncHTTPClient
9-
from tests.conftest import API_TOKEN, API_URL
9+
from tests.unit.conftest import API_TOKEN, API_URL
1010

1111

1212
@pytest.fixture

tests/http/test_base_service.py renamed to tests/unit/http/test_base_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from mpt_api_client.http import Service
22
from mpt_api_client.http.query_state import QueryState
3-
from tests.conftest import DummyModel
4-
from tests.http.conftest import DummyService
3+
from tests.unit.conftest import DummyModel
4+
from tests.unit.http.conftest import DummyService
55

66

77
class ParametrisedDummyService( # noqa: WPS215

tests/http/test_client.py renamed to tests/unit/http/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from mpt_api_client.exceptions import MPTError
88
from mpt_api_client.http.client import HTTPClient
9-
from tests.conftest import API_TOKEN, API_URL
9+
from tests.unit.conftest import API_TOKEN, API_URL
1010

1111

1212
def test_http_initialization(mocker):

0 commit comments

Comments
 (0)