FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support pytest 9 changes by s-t-e-v-e-n-k · Pull Request #590 · html5lib/html5lib-python · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .txt  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 9 additions & 9 deletions html5lib/tests/conftest.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,22 @@ def pytest_configure(config):
pytest.exit("\n".join(msgs))


def pytest_collect_file(path, parent):
dir = os.path.abspath(path.dirname)
def pytest_collect_file(file_path, parent):
dir = file_path.parent
dir_and_parents = set()
while dir not in dir_and_parents:
dir_and_parents.add(dir)
dir = os.path.dirname(dir)
dir = dir.parent

if _tree_construction in dir_and_parents:
if path.ext == ".dat":
return TreeConstructionFile.from_parent(parent, fspath=path)
if file_path.suffix == ".dat":
return TreeConstructionFile.from_parent(parent, path=file_path)
elif _tokenizer in dir_and_parents:
if path.ext == ".test":
return TokenizerFile.from_parent(parent, fspath=path)
if file_path.suffix == ".test":
return TokenizerFile.from_parent(parent, path=file_path)
elif _sanitizer_testdata in dir_and_parents:
if path.ext == ".dat":
return SanitizerFile.from_parent(parent, fspath=path)
if file_path.suffix == ".dat":
return SanitizerFile.from_parent(parent, path=file_path)


# Tiny wrapper to allow .from_parent constructors on older pytest for PY27
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
flake8==3.9.2 ; python_version < '3.6'
flake8>=5.0.4; python_version >= '3.6'
pytest>=4.6.10,<5 ; python_version < '3'
pytest>=5.4.2,<8 ; python_version >= '3'
pytest>=7,<10 ; python_version >= '3'
coverage>=5.1,<6
pytest-expect>=1.1.0,<2
mock>=3.0.5,<4 ; python_version < '3.3'
Expand Down

Back | FazBrowse Home | New Git URL