Skip to content

Commit d9a2878

Browse files
committed
linting: remove print statements from tests
1 parent 8902c09 commit d9a2878

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

tests/mmcif/test_read_mmcif.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import importlib.resources as pkg_resources
1212
else:
1313
import importlib_resources as pkg_resources
14+
1415
from pathlib import Path
1516
from urllib.error import HTTPError
1617

@@ -97,7 +98,6 @@ def test__read_pdb():
9798
"""Test private _read_pdb"""
9899
ppdb = PandasMmcif()
99100
_, txt = ppdb._read_mmcif(TESTDATA_FILENAME)
100-
print(txt)
101101
assert txt == three_eiy
102102

103103

@@ -336,9 +336,7 @@ def test_mmcif_pdb_conversion():
336336
)
337337
assert_frame_equal(
338338
pdb.df["HETATM"].drop(columns=["line_idx"]),
339-
mmcif_pdb.df["HETATM"]
340-
.drop(columns=["line_idx"])
341-
.reset_index(drop=True),
339+
mmcif_pdb.df["HETATM"].drop(columns=["line_idx"]).reset_index(drop=True),
342340
)
343341

344342
# single chain test
@@ -352,7 +350,5 @@ def test_mmcif_pdb_conversion():
352350
)
353351
assert_frame_equal(
354352
pdb.df["HETATM"].drop(columns=["line_idx"]),
355-
mmcif_pdb.df["HETATM"]
356-
.drop(columns=["line_idx"])
357-
.reset_index(drop=True),
353+
mmcif_pdb.df["HETATM"].drop(columns=["line_idx"]).reset_index(drop=True),
358354
)

tests/mmtf/test_write_mmtf.py

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def test_write_mmtf_bp():
2020
"1rcf",
2121
]
2222
for pdb in PDB_CODES:
23-
print(pdb)
2423
pm1 = PandasMmtf().fetch_mmtf(pdb)
2524
pm1.to_mmtf("test.mmtf")
2625
assert os.path.exists("test.mmtf")
@@ -51,7 +50,6 @@ def test_write_mmtf():
5150
"1rcf",
5251
]
5352
for pdb in PDB_CODES:
54-
print(pdb)
5553
pm1 = PandasMmtf().fetch_mmtf(pdb)
5654
write_mmtf(pd.concat([pm1.df["ATOM"], pm1.df["HETATM"]]), "test.mmtf")
5755
assert os.path.exists("test.mmtf")

tests/pdb/test_amino3to1.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ def test_sameindex():
159159
TESTDATA_1t48 = str(TEST_DATA.joinpath("1t48_995.pdb"))
160160
p1t48 = PandasPdb()
161161
p1t48.read_pdb(TESTDATA_1t48)
162-
print(p1t48)
163162
p1t48.df["ATOM"].index = np.zeros(p1t48.df["ATOM"].shape[0], dtype=int)
164163

165164
expect_res = [
@@ -490,12 +489,8 @@ def test_multichain():
490489
expect_chain = ["A" for _ in range(88)] + ["B" for _ in range(94)]
491490
got_chain = list(transl["chain_id"].values)
492491

493-
got_res_a = list(
494-
transl.loc[transl["chain_id"] == "A", "residue_name"].values
495-
)
496-
got_res_b = list(
497-
transl.loc[transl["chain_id"] == "B", "residue_name"].values
498-
)
492+
got_res_a = list(transl.loc[transl["chain_id"] == "A", "residue_name"].values)
493+
got_res_b = list(transl.loc[transl["chain_id"] == "B", "residue_name"].values)
499494

500495
assert expect_chain == got_chain
501496
assert expect_res_a == got_res_a

tests/pdb/test_read_pdb.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import importlib.resources as pkg_resources
1212
else:
1313
import importlib_resources as pkg_resources
14+
1415
from urllib.error import HTTPError
1516

1617
import numpy as np
@@ -94,8 +95,7 @@
9495
def test__read_pdb():
9596
"""Test private _read_pdb"""
9697
ppdb = PandasPdb()
97-
path, txt = ppdb._read_pdb(TESTDATA_FILENAME)
98-
print(txt)
98+
_, txt = ppdb._read_pdb(TESTDATA_FILENAME)
9999
assert txt == three_eiy
100100

101101

@@ -104,8 +104,7 @@ def test__read_pdb_raises():
104104
Test if ValueError is raised for wrong file formats."""
105105

106106
expect = (
107-
"Wrong file format; allowed file formats are "
108-
".pdb, .pdb.gz, .ent, .ent.gz"
107+
"Wrong file format; allowed file formats are " ".pdb, .pdb.gz, .ent, .ent.gz"
109108
)
110109

111110
def run_code_1():

0 commit comments

Comments
 (0)