GAMPTeam / vampyre

Approximate Message Passing in Python
MIT License
65 stars 28 forks source link

Implement PyTest Framework (#2) #5

Closed eric-tramel closed 6 years ago

eric-tramel commented 7 years ago

This is the merge for changing from Nose over to PyTest (see Issue #2). I'm interested to see what everyone's thoughts are. I think that Sundeep already gives it a 👍 .

sdrangan commented 7 years ago

Eric, How do you run the tests?

When I go to run an individual test, it can't find the vampyre package: For example, I cd to:

vampyre\test\test_common

Then, I run

python test_utils.py

Then, I get the error:

Traceback (most recent call last): File "test_utils.py", line 5, in from vampyre.common.utils import repeat_axes ImportError: No module named 'vampyre'

amanoel commented 7 years ago

I don't know what kind of setup you guys are using, are you adding the package to the PYTHONPATH or reinstalling it everytime?

I was getting the same error, then I've done python setup.py install --user

Now I have the package installed... But, when __init__.py is called, I get an error on the imports

ModuleNotFoundError: No module named 'vampyre.common'

And that's because, afaik, the submodules also need to be specified in the setup.py. Alternatively one can import find_packages from setuptools and replace the packages entry by

packages = find_packages()

Then the tests work fine.

sdrangan commented 6 years ago

I already implemented these changes separately before I understood how to do pull requests