-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore deprecated
pkg_resources.declare_namespace
warnings (#611)
As of setuptools v67.3.0 the use of pkg_resources.declare_namespace in lib/mpl_toolkits/__init__.py raises a DeprecationWarning. See also: matplotlib/matplotlib#25244 Run tests directly rather than as a subprocess so that pytest filterwarnings options have their intended effect.
- Loading branch information
Showing
4 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Ignore deprecated ``pkg_resources.declare_namespace`` warnings in pytest |
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
from __future__ import annotations | ||
|
||
import procrunner | ||
from dxtbx.command_line import print_header | ||
|
||
|
||
def test_print_header(dials_data): | ||
def test_print_header(dials_data, capsys): | ||
screen = dials_data("thaumatin_eiger_screen", pathlib=True) | ||
master = screen / "Therm_6_1_master.h5" | ||
result = procrunner.run(["dxtbx.print_header", master]) | ||
assert not result.returncode and not result.stderr | ||
print_header.run([str(master)]) | ||
|
||
expected_output = [ | ||
f"=== {master} ===", | ||
"Using header reader: FormatNXmxDLS16M", | ||
] | ||
|
||
captured = capsys.readouterr() | ||
assert not captured.err | ||
for record in expected_output: | ||
assert record.strip().encode("latin-1") in result.stdout, record | ||
assert record.strip() in captured.out, record |
This file contains 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from __future__ import annotations | ||
|
||
import procrunner | ||
from dxtbx.command_line import show_mask_info | ||
|
||
|
||
def test_show_mask_info(dials_data): | ||
def test_show_mask_info(dials_data, capsys): | ||
data = dials_data("image_examples", pathlib=True) / "dectris_eiger_master.h5" | ||
|
||
result = procrunner.run(["dxtbx.show_mask_info", data]) | ||
assert not result.returncode and not result.stderr | ||
|
||
assert b"Module 0 has 637992 masked pixels of 10166590" in result.stdout | ||
show_mask_info.run([str(data)]) | ||
captured = capsys.readouterr() | ||
assert not captured.err | ||
assert "Module 0 has 637992 masked pixels of 10166590" in captured.out |