DeepRank / pdb2sql

Fast and versatile biomolecular structure PDB file parser using SQL queries
https://pdb2sql.readthedocs.io
Apache License 2.0
24 stars 12 forks source link

Tests fail or not found #47

Closed joaomcteixeira closed 4 years ago

joaomcteixeira commented 4 years ago

Please notice this behavior when running the tests:

Steps to reproduce:

# from within the cloned repository folder
conda create -n pdb2sqlgit python=3.7
conda activate pdb2sqlgit
python setup.py develop
python setup.py test

What you be a way to run the test locally, instead? Am I doing something wrong?

$ python setup.py test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing pdb2sql.egg-info/PKG-INFO
writing dependency_links to pdb2sql.egg-info/dependency_links.txt
writing requirements to pdb2sql.egg-info/requires.txt
writing top-level names to pdb2sql.egg-info/top_level.txt
reading manifest file 'pdb2sql.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pdb2sql.egg-info/SOURCES.txt'
running build_ext
tests (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: tests (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests
Traceback (most recent call last):
  File "/home/joao/anaconda3/envs/pdb2sqlgit/lib/python3.7/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
ModuleNotFoundError: No module named 'tests'

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)
Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=1 errors=1 failures=0>

I am on:

commit a03707d7c5b77b2b4f7a9c6caf526c40ae6fa7f7 (HEAD -> master, origin/master, origin/HEAD)
Author: NicoRenaud <nicolas.gm.renaud@gmail.com>
Date:   Thu Apr 30 22:09:46 2020 +0200

    fix align interface

Related to the JOSS revision: https://github.com/openjournals/joss-reviews/issues/2077

NicoRenaud commented 4 years ago

To run the test locally you can use :

cd test
pytest

you can install all the required package to run the test (i.e. coveralls, pytest and pytest-cov) with:

pip install -e .[test]

Let me know if that works for you and thanks for your input !

joaomcteixeira commented 4 years ago

I understand, so please update with CONTRIBUTING file with those instructions, because the current instructions have the output I referred. Sorry, I forgot to mention the CONTRIBUTING file in my previous message.

Regarding the mandatory requirement of running pytest from the tests folder, you can overcome this by assigning the paths you use in tests relative to the test files themselves and not to the cwd.

test_folder = Path(__file__).resolve().parent

and work from there.

Cheers and nice package! :wink: