Skip to content

Commit

Permalink
Enable pytest socket to all the tests using live_server fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
djamg committed Dec 14, 2023
1 parent 973c96b commit eb10a7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions tests/e2e/basic/video_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Test livestream urls."""

import pytest
from playwright.sync_api import Page, expect

VETINARI_EMAIL = '[email protected]'
Expand All @@ -14,7 +13,6 @@ def wait_until_recaptcha_loaded(page: Page) -> None:
)


@pytest.mark.enable_socket()
def test_login_add_livestream(
db_session, live_server, user_vetinari, project_expo2010, page: Page
):
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# pylint: disable=redefined-outer-name

import pytest
from pytest_socket import enable_socket


@pytest.fixture()
Expand All @@ -11,5 +10,7 @@ def db_session(db_session_truncate):
return db_session_truncate


def pytest_runtest_setup() -> None:
enable_socket()
def pytest_collection_modifyitems(items):
for item in items:
if 'live_server' in getattr(item, 'fixturenames', ()):
item.add_marker(pytest.mark.enable_socket())

0 comments on commit eb10a7a

Please sign in to comment.