Skip to content

Commit

Permalink
linting: remove print statements from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
a-r-j committed Aug 1, 2024
1 parent 8902c09 commit d9a2878
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
10 changes: 3 additions & 7 deletions tests/mmcif/test_read_mmcif.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import importlib.resources as pkg_resources
else:
import importlib_resources as pkg_resources

from pathlib import Path
from urllib.error import HTTPError

Expand Down Expand Up @@ -97,7 +98,6 @@ def test__read_pdb():
"""Test private _read_pdb"""
ppdb = PandasMmcif()
_, txt = ppdb._read_mmcif(TESTDATA_FILENAME)
print(txt)
assert txt == three_eiy


Expand Down Expand Up @@ -336,9 +336,7 @@ def test_mmcif_pdb_conversion():
)
assert_frame_equal(
pdb.df["HETATM"].drop(columns=["line_idx"]),
mmcif_pdb.df["HETATM"]
.drop(columns=["line_idx"])
.reset_index(drop=True),
mmcif_pdb.df["HETATM"].drop(columns=["line_idx"]).reset_index(drop=True),
)

# single chain test
Expand All @@ -352,7 +350,5 @@ def test_mmcif_pdb_conversion():
)
assert_frame_equal(
pdb.df["HETATM"].drop(columns=["line_idx"]),
mmcif_pdb.df["HETATM"]
.drop(columns=["line_idx"])
.reset_index(drop=True),
mmcif_pdb.df["HETATM"].drop(columns=["line_idx"]).reset_index(drop=True),
)
2 changes: 0 additions & 2 deletions tests/mmtf/test_write_mmtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def test_write_mmtf_bp():
"1rcf",
]
for pdb in PDB_CODES:
print(pdb)
pm1 = PandasMmtf().fetch_mmtf(pdb)
pm1.to_mmtf("test.mmtf")
assert os.path.exists("test.mmtf")
Expand Down Expand Up @@ -51,7 +50,6 @@ def test_write_mmtf():
"1rcf",
]
for pdb in PDB_CODES:
print(pdb)
pm1 = PandasMmtf().fetch_mmtf(pdb)
write_mmtf(pd.concat([pm1.df["ATOM"], pm1.df["HETATM"]]), "test.mmtf")
assert os.path.exists("test.mmtf")
Expand Down
9 changes: 2 additions & 7 deletions tests/pdb/test_amino3to1.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def test_sameindex():
TESTDATA_1t48 = str(TEST_DATA.joinpath("1t48_995.pdb"))
p1t48 = PandasPdb()
p1t48.read_pdb(TESTDATA_1t48)
print(p1t48)
p1t48.df["ATOM"].index = np.zeros(p1t48.df["ATOM"].shape[0], dtype=int)

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

got_res_a = list(
transl.loc[transl["chain_id"] == "A", "residue_name"].values
)
got_res_b = list(
transl.loc[transl["chain_id"] == "B", "residue_name"].values
)
got_res_a = list(transl.loc[transl["chain_id"] == "A", "residue_name"].values)
got_res_b = list(transl.loc[transl["chain_id"] == "B", "residue_name"].values)

assert expect_chain == got_chain
assert expect_res_a == got_res_a
Expand Down
7 changes: 3 additions & 4 deletions tests/pdb/test_read_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import importlib.resources as pkg_resources
else:
import importlib_resources as pkg_resources

from urllib.error import HTTPError

import numpy as np
Expand Down Expand Up @@ -94,8 +95,7 @@
def test__read_pdb():
"""Test private _read_pdb"""
ppdb = PandasPdb()
path, txt = ppdb._read_pdb(TESTDATA_FILENAME)
print(txt)
_, txt = ppdb._read_pdb(TESTDATA_FILENAME)
assert txt == three_eiy


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

expect = (
"Wrong file format; allowed file formats are "
".pdb, .pdb.gz, .ent, .ent.gz"
"Wrong file format; allowed file formats are " ".pdb, .pdb.gz, .ent, .ent.gz"
)

def run_code_1():
Expand Down

0 comments on commit d9a2878

Please sign in to comment.