Commit d2a928b0 authored by Karl Leswing's avatar Karl Leswing
Browse files

Pytest Port

parent 614d3591
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ install:
  - pip install coveralls
  - python setup.py install
script:
  - nosetests -q --with-flaky -a '!slow' --with-coverage --cover-package=deepchem
  - pytest -m "not slow" deepchem
    -v deepchem --nologcapture
  - if [ $TRAVIS_PYTHON_VERSION == '3.7' ]; then
    find ./deepchem | grep .py$ |xargs python -m doctest -v;
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ from deepchem.models.autoencoder_models.autoencoder import TensorflowMoleculeEnc

class TestTensorflowEncoders(TestCase):

  @attr('slow')
  @pytest.mark.slow('slow')
  def test_fit(self):
    tf_enc = TensorflowMoleculeEncoder.zinc_encoder()

+3 −2
Original line number Diff line number Diff line
@@ -10,8 +10,9 @@ import logging
import unittest
import os
import numpy as np
import pytest

import deepchem as dc
from nose.tools import nottest
from deepchem.utils import rdkit_util

logger = logging.getLogger(__name__)
@@ -147,7 +148,7 @@ class TestBindingPocket(unittest.TestCase):

    assert len(pockets) < len(all_pockets)

  @nottest
  @pytest.mark.skip(reson="Unknown")
  def test_rf_convex_find_pockets(self):
    """Test that filter with pre-trained RF models works."""
    if sys.version_info >= (3, 0):
+12 −10
Original line number Diff line number Diff line
@@ -7,9 +7,11 @@ __license__ = "MIT"

import unittest
import os
from nose.plugins.attrib import attr
from nose.tools import nottest

import sys

import pytest

import deepchem as dc


@@ -18,14 +20,14 @@ class TestDocking(unittest.TestCase):
  Does sanity checks on pose generation.
  """

  @nottest
  @pytest.mark.skip(reason="Unknown")
  def test_vina_grid_rf_docker_init(self):
    """Test that VinaGridRFDocker can be initialized."""
    if sys.version_info >= (3, 0):
      return
    docker = dc.dock.VinaGridRFDocker(exhaustiveness=1, detect_pockets=False)

  @nottest
  @pytest.mark.skip(reason="Unknown")
  def test_pocket_vina_grid_rf_docker_init(self):
    """Test that VinaGridRFDocker w/pockets can be initialized."""
    if sys.version_info >= (3, 0):
@@ -45,7 +47,7 @@ class TestDocking(unittest.TestCase):
    docker = dc.dock.VinaGridDNNDocker(exhaustiveness=1, detect_pockets=True)
  '''

  @attr("slow")
  @pytest.mark.slow
  def test_vina_grid_rf_docker_dock(self):
    """Test that VinaGridRFDocker can dock."""
    if sys.version_info >= (3, 0):
@@ -64,7 +66,7 @@ class TestDocking(unittest.TestCase):
    assert os.path.exists(protein_docked)
    assert os.path.exists(ligand_docked)

  @nottest
  @pytest.mark.skip(reason="Unknown")
  def test_vina_grid_rf_docker_specified_pocket(self):
    """Test that VinaGridRFDocker can dock into spec. pocket."""
    if sys.version_info >= (3, 0):
@@ -85,7 +87,7 @@ class TestDocking(unittest.TestCase):
    # Check returned files exist
    assert score.shape == (1,)

  @nottest
  @pytest.mark.skip(reason="Unknown")
  def test_pocket_vina_grid_rf_docker_dock(self):
    """Test that VinaGridRFDocker can dock."""
    if sys.version_info >= (3, 0):
@@ -106,7 +108,7 @@ class TestDocking(unittest.TestCase):
    assert score.shape == (1,)

  '''
  @attr("slow")
  @pytest.mark.slow("slow")
  def test_vina_grid_dnn_docker_dock(self):
    """Test that VinaGridDNNDocker can dock."""
    current_dir = os.path.dirname(os.path.realpath(__file__))
@@ -122,7 +124,7 @@ class TestDocking(unittest.TestCase):
    assert os.path.exists(protein_docked)
    assert os.path.exists(ligand_docked)

  @attr('slow')
  @pytest.mark.slow('slow')
  def test_pocket_vina_grid_dnn_docker_dock(self):
    """Test that VinaGridDNNDocker can dock."""
    if sys.version_info >= (3, 0):
+5 −5
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import os
import sys
import unittest
import deepchem as dc
from nose.plugins.attrib import attr
import pytest


class TestPoseGeneration(unittest.TestCase):
@@ -17,13 +17,13 @@ class TestPoseGeneration(unittest.TestCase):
  Does sanity checks on pose generation.
  """

  @attr("slow")
  @pytest.mark.slow
  def test_vina_initialization(self):
    """Test that VinaPoseGenerator can be initialized."""
    # Note this may download autodock Vina...
    vpg = dc.dock.VinaPoseGenerator(detect_pockets=False, exhaustiveness=1)

  @attr("slow")
  @pytest.mark.slow("slow")
  def test_pocket_vina_initialization(self):
    """Test that VinaPoseGenerator can be initialized."""
    # Note this may download autodock Vina...
@@ -31,7 +31,7 @@ class TestPoseGeneration(unittest.TestCase):
      return
    vpg = dc.dock.VinaPoseGenerator(detect_pockets=True, exhaustiveness=1)

  @attr("slow")
  @pytest.mark.slow("slow")
  def test_vina_poses(self):
    """Test that VinaPoseGenerator creates pose files."""
    current_dir = os.path.dirname(os.path.realpath(__file__))
@@ -47,7 +47,7 @@ class TestPoseGeneration(unittest.TestCase):
    assert os.path.exists(protein_pose_file)
    assert os.path.exists(ligand_pose_file)

  @attr('slow')
  @pytest.mark.slow('slow')
  def test_pocket_vina_poses(self):
    """Test that VinaPoseGenerator creates pose files."""
    if sys.version_info >= (3, 0):
Loading