Skip to content

Commit

Permalink
drop Python 3.7 support (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsv1 authored Oct 21, 2023
1 parent bd0790e commit 44cf5e3
Show file tree
Hide file tree
Showing 57 changed files with 33 additions and 416 deletions.
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
asynctest==0.13.0
baby-steps==1.3.0
bump2version==1.0.1
codecov==2.1.13
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ python_files = test_*.py
python_classes =
python_functions = test_*
markers = only
asyncio_mode = strict
asyncio_mode = auto
filterwarnings =
ignore:Deprecated
addopts =
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def find_dev_required():
long_description_content_type="text/markdown",
author="Nikita Tsvetkov",
author_email="[email protected]",
python_requires=">=3.7",
python_requires=">=3.8",
url="https://github.com/vedro-universe/vedro",
project_urls={
"Docs": "https://vedro.io/",
Expand All @@ -36,7 +36,6 @@ def find_dev_required():
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from os import linesep
from pathlib import Path

Expand All @@ -10,8 +9,6 @@
from ._utils import create_config, read_config


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
async def test_plugin_manager_no_file(tmp_path: Path):
with given:
config_path = create_config(tmp_path)
Expand All @@ -37,8 +34,6 @@ async def test_plugin_manager_no_file(tmp_path: Path):
])


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
async def test_plugin_manager_no_config(tmp_path: Path):
with given:
config_path = create_config(tmp_path, [])
Expand All @@ -64,8 +59,6 @@ async def test_plugin_manager_no_config(tmp_path: Path):
])


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
async def test_plugin_manager_no_plugins_section(tmp_path: Path):
with given:
config_path = create_config(tmp_path, [
Expand Down Expand Up @@ -98,8 +91,6 @@ async def test_plugin_manager_no_plugins_section(tmp_path: Path):
])


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
async def test_plugin_manager_no_plugins(tmp_path: Path):
with given:
config_path = create_config(tmp_path, [
Expand Down Expand Up @@ -134,8 +125,6 @@ async def test_plugin_manager_no_plugins(tmp_path: Path):
])


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
async def test_plugin_manager_no_target_plugin(tmp_path: Path):
with given:
config_path = create_config(tmp_path, [
Expand Down Expand Up @@ -178,8 +167,6 @@ async def test_plugin_manager_no_target_plugin(tmp_path: Path):
])


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
async def test_plugin_manager_no_enabled_attr(tmp_path: Path):
with given:
config_path = create_config(tmp_path, [
Expand Down Expand Up @@ -226,8 +213,6 @@ async def test_plugin_manager_no_enabled_attr(tmp_path: Path):
])


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
@pytest.mark.parametrize("enabled", [True, False])
async def test_plugin_manager_enabled_enabled(enabled: bool, *, tmp_path: Path):
with given:
Expand Down Expand Up @@ -266,8 +251,6 @@ async def test_plugin_manager_enabled_enabled(enabled: bool, *, tmp_path: Path):
])


@pytest.mark.asyncio
@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires python3.8 or higher")
@pytest.mark.parametrize("enabled", [True, False])
async def test_plugin_manager_disabled_enabled(enabled: bool, *, tmp_path: Path):
with given:
Expand Down
5 changes: 0 additions & 5 deletions tests/commands/run_command/test_run_command.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from pathlib import Path
from unittest.mock import Mock

import pytest
from baby_steps import given, then, when
from pytest import raises

Expand All @@ -25,7 +24,6 @@ class Terminator(vedro.Config.Plugins.Terminator):
pass


@pytest.mark.asyncio
async def test_run_command_without_scenarios(arg_parser_: Mock):
with given:
command = RunCommand(CustomConfig, arg_parser_)
Expand All @@ -38,7 +36,6 @@ async def test_run_command_without_scenarios(arg_parser_: Mock):
assert str(exc.value) == "1"


@pytest.mark.asyncio
async def test_run_command_with_scenarios(tmp_dir: Path, arg_parser_: Mock):
with given:
command = RunCommand(CustomConfig, arg_parser_)
Expand All @@ -52,7 +49,6 @@ async def test_run_command_with_scenarios(tmp_dir: Path, arg_parser_: Mock):
assert str(exc.value) == "0"


@pytest.mark.asyncio
async def test_run_command_validate_plugin(tmp_dir: Path, arg_parser_: Mock):
with given:
class ValidConfig(CustomConfig):
Expand All @@ -73,7 +69,6 @@ class Terminator(vedro.Config.Plugins.Terminator):
assert str(exc.value) == "0"


@pytest.mark.asyncio
async def test_run_command_validate_plugin_error(arg_parser_: Mock):
with given:
class InvalidConfig(CustomConfig):
Expand Down
1 change: 0 additions & 1 deletion tests/commands/version_command/test_version_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def test_inheritance():
assert isinstance(command, Command)


@pytest.mark.asyncio
async def test_run(*, console_, arg_parser_: Mock):
with given:
command = VersionCommand(Config, arg_parser_, console_factory=lambda: console_)
Expand Down
4 changes: 0 additions & 4 deletions tests/core/config_loader/test_config_file_loader.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from pathlib import Path

import pytest
from baby_steps import given, then, when

from vedro.core import Config, ConfigFileLoader


@pytest.mark.asyncio
async def test_config_file_loader(*, tmp_path: Path):
with given:
config = Config
Expand All @@ -25,7 +23,6 @@ async def test_config_file_loader(*, tmp_path: Path):
assert res != config


@pytest.mark.asyncio
async def test_config_file_loader_empty_file(*, tmp_path: Path):
with given:
config = Config
Expand All @@ -40,7 +37,6 @@ async def test_config_file_loader_empty_file(*, tmp_path: Path):
assert res == config


@pytest.mark.asyncio
async def test_config_file_loader_not_exist(*, tmp_path: Path):
with given:
config = Config
Expand Down
8 changes: 0 additions & 8 deletions tests/core/exp/local_storage/test_local_storage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from pathlib import Path

import pytest
from baby_steps import given, then, when
from niltype import Nil
from pytest import raises
Expand All @@ -13,7 +12,6 @@
__all__ = ("plugin", "local_storage",) # fixtures


@pytest.mark.asyncio
async def test_put(local_storage: LocalStorage):
with given:
key, value = "<key>", "<value>"
Expand All @@ -25,7 +23,6 @@ async def test_put(local_storage: LocalStorage):
assert res is None


@pytest.mark.asyncio
async def test_get(local_storage: LocalStorage):
with given:
key, value = "<key>", "<value>"
Expand All @@ -38,7 +35,6 @@ async def test_get(local_storage: LocalStorage):
assert res == value


@pytest.mark.asyncio
async def test_get_nonexisting_key(local_storage: LocalStorage):
with given:
key = "<key>"
Expand All @@ -50,7 +46,6 @@ async def test_get_nonexisting_key(local_storage: LocalStorage):
assert res is Nil


@pytest.mark.asyncio
async def test_get_without_flush(plugin: Plugin, tmp_path: Path):
with given:
key, value = "<key>", "<value>"
Expand All @@ -67,7 +62,6 @@ async def test_get_without_flush(plugin: Plugin, tmp_path: Path):
assert res is Nil


@pytest.mark.asyncio
async def test_get_with_flush(plugin: Plugin, tmp_path: Path):
with given:
key, value = "<key>", "<value>"
Expand All @@ -85,7 +79,6 @@ async def test_get_with_flush(plugin: Plugin, tmp_path: Path):
assert res == value


@pytest.mark.asyncio
async def test_flush_empty_storage(local_storage: LocalStorage):
with when:
res = await local_storage.flush()
Expand All @@ -94,7 +87,6 @@ async def test_flush_empty_storage(local_storage: LocalStorage):
assert res is None


@pytest.mark.asyncio
async def test_flush(local_storage: LocalStorage):
with given:
key, value = "<key>", "<value>"
Expand Down
12 changes: 1 addition & 11 deletions tests/core/scenario_discoverer/test_scenario_discoverer.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import sys

if sys.version_info >= (3, 8):
from unittest.mock import AsyncMock, MagicMock
else:
from asynctest.mock import CoroutineMock as AsyncMock, MagicMock

from pathlib import Path
from unittest.mock import Mock, call

import pytest
from unittest.mock import AsyncMock, MagicMock, Mock, call

from vedro import Scenario
from vedro.core import (
Expand Down Expand Up @@ -40,7 +31,6 @@ def create_scenario(filename):
return Mock(Scenario, __file__=filename)


@pytest.mark.asyncio
async def test_scenario_discoverer():
root = Path("/tmp")
scenario1 = create_scenario(root / "scenario-1.py")
Expand Down
5 changes: 0 additions & 5 deletions tests/core/scenario_finder/test_scenario_file_finder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from pathlib import Path
from typing import List

import pytest

from vedro.core._scenario_finder import ScenarioFileFinder
from vedro.core._scenario_finder._file_filters import DunderFilter, HiddenFilter

Expand All @@ -14,7 +12,6 @@ def _create_file_tree(tree: List[Path]) -> List[Path]:
return tree


@pytest.mark.asyncio
async def test_scenario_file_finder(tmp_path: Path):
tree = _create_file_tree([
(tmp_path / ".DS_Store"),
Expand All @@ -38,7 +35,6 @@ async def test_scenario_file_finder(tmp_path: Path):
assert len(paths) == len(tree)


@pytest.mark.asyncio
async def test_scenario_file_finder_with_file_filter(tmp_path: Path):
subtree = [
(tmp_path / "scenario1.py"),
Expand All @@ -59,7 +55,6 @@ async def test_scenario_file_finder_with_file_filter(tmp_path: Path):
assert len(paths) == len(subtree)


@pytest.mark.asyncio
async def test_scenario_file_finder_with_dir_filter(tmp_path: Path):
subtree = [
(tmp_path / "scenario1.py"),
Expand Down
3 changes: 0 additions & 3 deletions tests/core/scenario_loader/test_scenario_file_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from vedro.core._scenario_loader import ScenarioFileLoader


@pytest.mark.asyncio
@pytest.mark.parametrize("name", [
"Scenario", # default
"TmpScenario", # custom name
Expand All @@ -32,7 +31,6 @@ class {name}(vedro.Scenario):
assert len(scenarios) == 1


@pytest.mark.asyncio
async def test_scenarios_file_loader(tmp_path: Path):
with given:
path = tmp_path / "scenario.py"
Expand All @@ -53,7 +51,6 @@ class UpdatedUserScenario(vedro.Scenario):
assert len(scenarios) == 2


@pytest.mark.asyncio
async def test_template_scenario_file_loader(tmp_path: Path):
with given:
path = tmp_path / "scenario.py"
Expand Down
2 changes: 0 additions & 2 deletions tests/core/scenario_orderer/test_plain_scenario_orderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def orderer() -> PlainScenarioOrderer:
return PlainScenarioOrderer()


@pytest.mark.asyncio
async def test_sort_no_scenarios(*, orderer: PlainScenarioOrderer):
with given:
scenarios = []
Expand All @@ -24,7 +23,6 @@ async def test_sort_no_scenarios(*, orderer: PlainScenarioOrderer):
assert scenarios == []


@pytest.mark.asyncio
async def test_sort_scenarios(*, orderer: PlainScenarioOrderer):
with given:
orig_scenarios = {path: make_vscenario(path) for path in [
Expand Down
2 changes: 0 additions & 2 deletions tests/core/scenario_orderer/test_stable_scenario_orderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def orderer() -> StableScenarioOrderer:
return StableScenarioOrderer()


@pytest.mark.asyncio
async def test_sort_no_scenarios(*, orderer: StableScenarioOrderer):
with given:
scenarios = []
Expand All @@ -24,7 +23,6 @@ async def test_sort_no_scenarios(*, orderer: StableScenarioOrderer):
assert scenarios == []


@pytest.mark.asyncio
async def test_sort_scenarios(*, orderer: StableScenarioOrderer):
with given:
orig_scenarios = {path: make_vscenario(path) for path in [
Expand Down
8 changes: 1 addition & 7 deletions tests/core/scenario_runner/_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from pathlib import Path
from time import monotonic_ns
from typing import Any, Callable, List, Optional, Type
from unittest.mock import AsyncMock

import pytest

Expand All @@ -15,12 +15,6 @@
VirtualStep,
)

if sys.version_info >= (3, 8):
from unittest.mock import AsyncMock
else:
from asynctest.mock import CoroutineMock as AsyncMock


__all__ = ("dispatcher_", "runner", "interrupt_exception", "make_vstep", "make_vscenario",
"make_scenario_result", "make_aggregated_result", "AsyncMock",)

Expand Down
Loading

0 comments on commit 44cf5e3

Please sign in to comment.