Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import shutil
import subprocess
import sys
from collections.abc import Callable, Generator
from dataclasses import dataclass, field
from pathlib import Path
Expand Down Expand Up @@ -84,8 +83,3 @@ def print_mock_fixture() -> Generator[PrintMock, None, None]:
new_print = get_testing_print_function(print_mock.calls)
with patch("builtins.print", new=new_print):
yield print_mock


needs_py310 = pytest.mark.skipif(
sys.version_info < (3, 10), reason="requires python3.10+"
)
4 changes: 2 additions & 2 deletions tests/test_advanced/test_decimal/test_tutorial001.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import pytest
from sqlmodel import create_engine

from ...conftest import PrintMock, needs_py310
from ...conftest import PrintMock


@pytest.fixture(
name="mod",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_advanced/test_uuid/test_tutorial001.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from dirty_equals import IsUUID
from sqlmodel import create_engine

from ...conftest import PrintMock, needs_py310
from ...conftest import PrintMock


@pytest.fixture(
name="mod",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_advanced/test_uuid/test_tutorial002.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from dirty_equals import IsUUID
from sqlmodel import create_engine

from ...conftest import PrintMock, needs_py310
from ...conftest import PrintMock


@pytest.fixture(
name="mod",
params=[
pytest.param("tutorial002_py310", marks=needs_py310),
pytest.param("tutorial002_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from sqlmodel import create_engine

from tests.conftest import PrintMock, needs_py310
from tests.conftest import PrintMock


def check_calls(calls: list[list[str | dict[str, Any]]]) -> None:
Expand Down Expand Up @@ -138,8 +138,8 @@ def check_calls(calls: list[list[str | dict[str, Any]]]) -> None:
@pytest.fixture(
name="module",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial002_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
pytest.param("tutorial002_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tutorial/test_code_structure/test_tutorial001.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from sqlmodel import create_engine

from tests.conftest import PrintMock, needs_py310
from tests.conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -34,7 +34,7 @@ class Modules:
@pytest.fixture(
name="modules",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_modules(request: pytest.FixtureRequest) -> Modules:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tutorial/test_code_structure/test_tutorial002.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from sqlmodel import create_engine

from ...conftest import PrintMock, needs_py310
from ...conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -34,7 +34,7 @@ class Modules:
@pytest.fixture(
name="modules",
params=[
pytest.param("tutorial002_py310", marks=needs_py310),
pytest.param("tutorial002_py310"),
],
)
def get_modules(request: pytest.FixtureRequest) -> Modules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
from sqlalchemy.engine.reflection import Inspector
from sqlmodel import create_engine

from tests.conftest import needs_py310


@pytest.fixture(
name="module",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ....conftest import PrintMock, needs_py310
from ....conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -63,7 +63,7 @@
@pytest.fixture(
name="module",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ....conftest import PrintMock, needs_py310
from ....conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -43,7 +43,7 @@
@pytest.fixture(
name="module",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ....conftest import PrintMock, needs_py310
from ....conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -77,7 +77,7 @@ def get_module(request: pytest.FixtureRequest) -> ModuleType:
@pytest.mark.parametrize(
"module",
[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
indirect=True,
)
Expand All @@ -89,7 +89,7 @@ def test_tutorial001(print_mock: PrintMock, module: ModuleType):
@pytest.mark.parametrize(
"module",
[
pytest.param("tutorial002_py310", marks=needs_py310),
pytest.param("tutorial002_py310"),
],
indirect=True,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ....conftest import PrintMock, needs_py310
from ....conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -79,7 +79,7 @@
@pytest.fixture(
name="module",
params=[
pytest.param("tutorial003_py310", marks=needs_py310),
pytest.param("tutorial003_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ....conftest import PrintMock, needs_py310
from ....conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -53,7 +53,7 @@
@pytest.fixture(
name="module",
params=[
pytest.param("tutorial004_py310", marks=needs_py310),
pytest.param("tutorial004_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ....conftest import PrintMock, needs_py310
from ....conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -55,7 +55,7 @@
@pytest.fixture(
name="module",
params=[
pytest.param("tutorial005_py310", marks=needs_py310),
pytest.param("tutorial005_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ....conftest import PrintMock, needs_py310
from ....conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -53,7 +53,7 @@
@pytest.fixture(
name="module",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import pytest

from ...conftest import coverage_run, needs_py310
from ...conftest import coverage_run


@pytest.mark.parametrize(
"module_name",
[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def test_create_db_and_table(cov_tmp_path: Path, module_name: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
from sqlalchemy.engine.reflection import Inspector
from sqlmodel import create_engine

from ...conftest import needs_py310


@pytest.fixture(
name="module",
params=[
pytest.param("tutorial002_py310", marks=needs_py310),
pytest.param("tutorial002_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
from sqlalchemy.engine.reflection import Inspector
from sqlmodel import create_engine

from ...conftest import needs_py310


@pytest.fixture(
name="module",
params=[
pytest.param("tutorial003_py310", marks=needs_py310),
pytest.param("tutorial003_py310"),
],
)
def get_module(request: pytest.FixtureRequest) -> ModuleType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from sqlmodel import create_engine

from ...conftest import PrintMock, needs_py310
from ...conftest import PrintMock

expected_calls = [
[
Expand Down Expand Up @@ -71,7 +71,7 @@ def get_module(request: pytest.FixtureRequest) -> ModuleType:
@pytest.mark.parametrize(
"module",
[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
indirect=True,
)
Expand All @@ -83,7 +83,7 @@ def test_tutorial001(print_mock: PrintMock, module: ModuleType):
@pytest.mark.parametrize(
"module",
[
pytest.param("tutorial002_py310", marks=needs_py310),
pytest.param("tutorial002_py310"),
],
indirect=True,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import pytest

from tests.conftest import needs_py310


@dataclass
class Modules:
Expand All @@ -17,7 +15,7 @@ class Modules:
@pytest.fixture(
name="modules_path",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_modules_path(request: pytest.FixtureRequest) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import pytest

from tests.conftest import needs_py310


@dataclass
class Modules:
Expand All @@ -17,7 +15,7 @@ class Modules:
@pytest.fixture(
name="modules_path",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_modules_path(request: pytest.FixtureRequest) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import pytest

from tests.conftest import needs_py310


@dataclass
class Modules:
Expand All @@ -17,7 +15,7 @@ class Modules:
@pytest.fixture(
name="modules_path",
params=[
pytest.param("tutorial001_py310", marks=needs_py310),
pytest.param("tutorial001_py310"),
],
)
def get_modules_path(request: pytest.FixtureRequest) -> str:
Expand Down
Loading
Loading