Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure on Linux #8

Closed
fonnesbeck opened this issue Feb 17, 2019 · 2 comments
Closed

Test failure on Linux #8

fonnesbeck opened this issue Feb 17, 2019 · 2 comments
Labels
bug Something is not working as intended

Comments

@fonnesbeck
Copy link

I've installed all the dependencies in requirements_dev but running pytest ./prism/tests results in a failure:

(dev) fonnesbeck@penguin:~/repos/PRISM (master)$ pytest prism/tests/
/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/pep8.py:110: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
================================ test session starts =================================
platform linux -- Python 3.7.1, pytest-4.2.0, py-1.7.0, pluggy-0.8.1 -- /home/fonnesbeck/anaconda3/envs/dev/bin/python
cachedir: .pytest_cache
Matplotlib: 3.0.2
Freetype: 2.9.1
rootdir: /home/fonnesbeck/repos/PRISM, inifile: setup.cfg
plugins: pep8-1.0.6, mpl-0.10, cov-2.6.1
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/_pytest/main.py", line 203, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/_pytest/main.py", line 242, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/pluggy/manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/pluggy/manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/pluggy/callers.py", line 182, in _multicall
INTERNALERROR>     next(gen)  # first yield
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/_pytest/warnings.py", line 149, in pytest_collection
INTERNALERROR>     config=config, ihook=config.hook, when="collect", item=None
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/contextlib.py", line 112, in __enter__
INTERNALERROR>     return next(self.gen)
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/_pytest/warnings.py", line 87, in catch_warnings_for_item
INTERNALERROR>     _setoption(warnings, arg)
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/site-packages/_pytest/warnings.py", line 26, in _setoption
INTERNALERROR>     category = wmod._getcategory(category)
INTERNALERROR>   File "/home/fonnesbeck/anaconda3/envs/dev/lib/python3.7/warnings.py", line 255, in _getcategory
INTERNALERROR>     raise _OptionError("invalid module name: %r" % (module,)) from None
INTERNALERROR> warnings._OptionError: invalid module name: 'prism._internal'

Running Py 3.7 (Anaconda) on Debian Linux

@1313e
Copy link
Owner

1313e commented Feb 18, 2019

@fonnesbeck Ah, I see what is happening here.
There is one very specific function for which PRISM needs to be installed before it can be executed (prism.get_info()), or at least its metadata must be available.
Therefore, I always ran the tests with PRISM already installed, as installing is in my opinion part of testing anyways.
I have made changes to the requirements_dev.txt file to make sure that it installs PRISM as well.
That also ensures that all normal requirements of PRISM are installed (which I had forgotten apparently).

Also, as a note, if you want to run all tests in PRISM, simply execute pytest (with no additional arguments) in the root of the repository.

@fonnesbeck
Copy link
Author

Perfect, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants