Skip to content

Commit

Permalink
Update test suite to modern pytest
Browse files Browse the repository at this point in the history
- Use pytest>=6.2 features (same as install_requires).
  When we can require >=7, can fix some more typing omissions and
  version checks.
- Replace testdir with pytester
- Replace py.test with pytest
- Replace tmpdir with tmp_path
- Remove (almost) all other uses of py
- Add some type annotations (not checked yet)

Ref pytest-dev#722.
  • Loading branch information
bluetech committed Nov 1, 2021
1 parent 5672d85 commit 9ddb274
Show file tree
Hide file tree
Showing 11 changed files with 771 additions and 692 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ pytest11 =
[options.extras_require]
testing =
filelock
pytest
psutil = psutil>=3.0
setproctitle = setproctitle

Expand Down
4 changes: 2 additions & 2 deletions src/xdist/workermanage.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,9 @@ def unserialize_warning_message(data):

kwargs = {"message": message, "category": category}
# access private _WARNING_DETAILS because the attributes vary between Python versions
for attr_name in warnings.WarningMessage._WARNING_DETAILS:
for attr_name in warnings.WarningMessage._WARNING_DETAILS: # type: ignore[attr-defined]
if attr_name in ("message", "category"):
continue
kwargs[attr_name] = data[attr_name]

return warnings.WarningMessage(**kwargs)
return warnings.WarningMessage(**kwargs) # type: ignore[arg-type]
Loading

0 comments on commit 9ddb274

Please sign in to comment.