Commit 41654ab3 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Pytest fixes

parent e5cea5e2
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -549,9 +549,3 @@ class TestSplitter(unittest.TestCase):
    assert not np.array_equal(train1.X, train2.X)
    assert not np.array_equal(valid1.X, valid2.X)
    assert not np.array_equal(test1.X, test2.X)


if __name__ == "__main__":
  import nose

  nose.run(defaultTest=__name__)
+6 −7
Original line number Diff line number Diff line
import unittest
import os
import tempfile
from nose.tools import assert_equal
from deepchem.utils import rdkit_util
from deepchem.utils import pdbqt_utils

@@ -33,11 +32,11 @@ class TestPDBQTUtils(unittest.TestCase):
      xyz, pdbqt_mol = rdkit_util.load_molecule(
          out_pdbqt, add_hydrogens=False, calc_charges=False)

    assert_equal(pdb_mol.GetNumAtoms(), pdbqt_mol.GetNumAtoms())
    assert pdb_mol.GetNumAtoms() == pdbqt_mol.GetNumAtoms()
    for atom_idx in range(pdb_mol.GetNumAtoms()):
      atom1 = pdb_mol.GetAtoms()[atom_idx]
      atom2 = pdbqt_mol.GetAtoms()[atom_idx]
      assert_equal(atom1.GetAtomicNum(), atom2.GetAtomicNum())
      assert atom1.GetAtomicNum() == atom2.GetAtomicNum()

  def test_convert_mol_to_pdbqt(self):
    """Test that a ligand molecule can be coverted to PDBQT."""
@@ -52,11 +51,11 @@ class TestPDBQTUtils(unittest.TestCase):
      pdbqt_utils.convert_mol_to_pdbqt(mol, outfile)
      pdbqt_xyz, pdbqt_mol = rdkit_util.load_molecule(
          outfile, add_hydrogens=False, calc_charges=False)
    assert_equal(pdbqt_mol.GetNumAtoms(), pdbqt_mol.GetNumAtoms())
    assert pdbqt_mol.GetNumAtoms() == pdbqt_mol.GetNumAtoms()
    for atom_idx in range(pdbqt_mol.GetNumAtoms()):
      atom1 = pdbqt_mol.GetAtoms()[atom_idx]
      atom2 = pdbqt_mol.GetAtoms()[atom_idx]
      assert_equal(atom1.GetAtomicNum(), atom2.GetAtomicNum())
      assert atom1.GetAtomicNum() == atom2.GetAtomicNum()

  def test_convert_protein_to_pdbqt(self):
    """Test a protein in a PDB can be converted to PDBQT."""
@@ -71,8 +70,8 @@ class TestPDBQTUtils(unittest.TestCase):
      pdbqt_utils.convert_protein_to_pdbqt(mol, outfile)
      pdbqt_xyz, pdbqt_mol = rdkit_util.load_molecule(
          outfile, add_hydrogens=False, calc_charges=False)
    assert_equal(pdbqt_mol.GetNumAtoms(), pdbqt_mol.GetNumAtoms())
    assert pdbqt_mol.GetNumAtoms() == pdbqt_mol.GetNumAtoms()
    for atom_idx in range(pdbqt_mol.GetNumAtoms()):
      atom1 = pdbqt_mol.GetAtoms()[atom_idx]
      atom2 = pdbqt_mol.GetAtoms()[atom_idx]
      assert_equal(atom1.GetAtomicNum(), atom2.GetAtomicNum())
      assert atom1.GetAtomicNum() == atom2.GetAtomicNum()

pytest.ini

0 → 100644
+4 −0
Original line number Diff line number Diff line
[pytest]
markers =
    slow: marks tests as slow (deselect with '-m "not slow"')
    serial