Skip to content

Commit 36f1fa1

Browse files
authored
Bump pytest to version 6.0.1 and yarl to 1.5.1 (Cog-Creators#4126)
* Update pytest to version 6.0.1 * remove some awful monkeypatching * use new import mode * Update yarl to 1.5.1
1 parent 3b5183d commit 36f1fa1

4 files changed

Lines changed: 7 additions & 21 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@
1717
| redbot\/vendored
1818
)/
1919
'''
20+
21+
[tool.pytest.ini_options]
22+
minversion = "6.0"
23+
addopts = "--import-mode=importlib"

redbot/pytest/core.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
import weakref
55

66
import pytest
7-
from _pytest.monkeypatch import MonkeyPatch
87
from redbot.core import Config
98
from redbot.core.bot import Red
109
from redbot.core import config as config_module, drivers
1110

1211
__all__ = [
13-
"monkeysession",
1412
"override_data_path",
1513
"coroutine",
1614
"driver",
@@ -30,13 +28,6 @@
3028
]
3129

3230

33-
@pytest.fixture(scope="session")
34-
def monkeysession(request):
35-
mpatch = MonkeyPatch()
36-
yield mpatch
37-
mpatch.undo()
38-
39-
4031
@pytest.fixture(autouse=True)
4132
def override_data_path(tmpdir):
4233
from redbot.core import data_manager

redbot/pytest/downloader.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from redbot.cogs.downloader.installable import Installable, InstalledModule
1111

1212
__all__ = [
13-
"patch_relative_to",
1413
"repo_manager",
1514
"repo",
1615
"bot_repo",
@@ -38,14 +37,6 @@ async def fake_current_commit(*args, **kwargs):
3837
return "fake_result"
3938

4039

41-
@pytest.fixture(scope="module", autouse=True)
42-
def patch_relative_to(monkeysession):
43-
def fake_relative_to(self, some_path: Path):
44-
return self
45-
46-
monkeysession.setattr("pathlib.Path.relative_to", fake_relative_to)
47-
48-
4940
@pytest.fixture
5041
def repo_manager(tmpdir_factory):
5142
rm = RepoManager()

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ install_requires =
5858
typing-extensions==3.7.4.2
5959
uvloop==0.14.0; sys_platform != "win32" and platform_python_implementation == "CPython"
6060
websockets==8.1
61-
yarl==1.5.0
61+
yarl==1.5.1
6262

6363
[options.extras_require]
6464
docs =
@@ -94,6 +94,7 @@ style =
9494
typed-ast==1.4.1
9595
test =
9696
astroid==2.4.2
97+
iniconfig==1.0.1
9798
isort==4.3.21
9899
lazy-object-proxy==1.4.3
99100
mccabe==0.6.1
@@ -103,12 +104,11 @@ test =
103104
py==1.9.0
104105
pylint==2.5.3
105106
pyparsing==2.4.7
106-
pytest==5.4.3
107+
pytest==6.0.1
107108
pytest-asyncio==0.14.0
108109
pytest-mock==3.2.0
109110
six==1.15.0
110111
toml==0.10.1
111-
wcwidth==0.2.5
112112
wrapt==1.12.1
113113

114114
[options.entry_points]

0 commit comments

Comments
 (0)