Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb502a5e

Browse files
committed
Support pytest 9 changes
The old py.path arguments to the hook functions have been removed as ofpytest 9, switch to the shiny new pathlib ones.
1 parentfd4f032 commitb502a5e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

‎html5lib/tests/conftest.py‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,22 @@ def pytest_configure(config):
9090
pytest.exit("\n".join(msgs))
9191

9292

93-
defpytest_collect_file(path,parent):
94-
dir=os.path.abspath(path.dirname)
93+
defpytest_collect_file(file_path,parent):
94+
dir=file_path.parent
9595
dir_and_parents=set()
9696
whiledirnotindir_and_parents:
9797
dir_and_parents.add(dir)
98-
dir=os.path.dirname(dir)
98+
dir=dir.parent
9999

100100
if_tree_constructionindir_and_parents:
101-
ifpath.ext==".dat":
102-
returnTreeConstructionFile.from_parent(parent,fspath=path)
101+
iffile_path.suffix==".dat":
102+
returnTreeConstructionFile.from_parent(parent,path=file_path)
103103
elif_tokenizerindir_and_parents:
104-
ifpath.ext==".test":
105-
returnTokenizerFile.from_parent(parent,fspath=path)
104+
iffile_path.suffix==".test":
105+
returnTokenizerFile.from_parent(parent,path=file_path)
106106
elif_sanitizer_testdataindir_and_parents:
107-
ifpath.ext==".dat":
108-
returnSanitizerFile.from_parent(parent,fspath=path)
107+
iffile_path.suffix==".dat":
108+
returnSanitizerFile.from_parent(parent,path=file_path)
109109

110110

111111
# Tiny wrapper to allow .from_parent constructors on older pytest for PY27

‎requirements-test.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
flake8==3.9.2 ; python_version < '3.6'
44
flake8>=5.0.4; python_version >= '3.6'
55
pytest>=4.6.10,<5 ; python_version < '3'
6-
pytest>=5.4.2,<8 ; python_version >= '3'
6+
pytest>=7,<10 ; python_version >= '3'
77
coverage>=5.1,<6
88
pytest-expect>=1.1.0,<2
99
mock>=3.0.5,<4 ; python_version < '3.3'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp