Update test suite to modern pytest
- 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 #722.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user