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

Tests fail: invalid module name: 'pymatgen.io.vasp.inputs' #2275

Closed
yurivict opened this issue Oct 22, 2021 · 10 comments
Closed

Tests fail: invalid module name: 'pymatgen.io.vasp.inputs' #2275

yurivict opened this issue Oct 22, 2021 · 10 comments

Comments

@yurivict
Copy link

Describe the bug
python-3.8 -m pytest fails:

===>   py38-pymatgen-2022.0.15 depends on file: /usr/local/bin/python3.8 - found
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/_pytest/main.py", line 206, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/_pytest/main.py", line 249, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/pluggy/callers.py", line 182, in _multicall
INTERNALERROR>     next(gen)  # first yield
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/_pytest/warnings.py", line 150, in pytest_collection
INTERNALERROR>     with catch_warnings_for_item(
INTERNALERROR>   File "/usr/local/lib/python3.8/contextlib.py", line 113, in __enter__
INTERNALERROR>     return next(self.gen)
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/_pytest/warnings.py", line 88, in catch_warnings_for_item
INTERNALERROR>     _setoption(warnings, arg)
INTERNALERROR>   File "/usr/local/lib/python3.8/site-packages/_pytest/warnings.py", line 27, in _setoption
INTERNALERROR>     category = wmod._getcategory(category)
INTERNALERROR>   File "/usr/local/lib/python3.8/warnings.py", line 262, in _getcategory
INTERNALERROR>     raise _OptionError("invalid module name: %r" % (module,)) from None
INTERNALERROR> warnings._OptionError: invalid module name: 'pymatgen.io.vasp.inputs'

no tests ran in 0.45 seconds
*** Error code 3

FreeBSD 13

@shyuep
Copy link
Member

shyuep commented Oct 22, 2021

You need to provide more details. That one liner does not give any information about your installation and there is no way we can diagnose where the problem lies.

@yurivict
Copy link
Author

Build log.

List of installed files.

@shyuep
Copy link
Member

shyuep commented Oct 22, 2021

I am not sure what is happening, but it would appear your pymatgen install is not complete. Further, you seem to be installing to the OS python, which is highly discoouraged. I would recommend you redo the install within a proper virtual env or even better, use Miniconda to do the install. Please reopen the issue if you still encounter problems.

@shyuep shyuep closed this as completed Oct 22, 2021
@AMDmi3
Copy link

AMDmi3 commented Apr 26, 2022

I've came by this failure and have fixed it partially. The testing is set up properly now, but

  1. Some tests fail because data files seem to be missing from the distribution.
  2. Other tests fail trying to access the network. Policy prohibits network access during build/testing, as it would hinder tests reproducibility and stability.
  3. Because these attempts are made directly from the root of test code
    with open(os.path.join(test_dir, "LiCoO2_k_xanes.json")) as fp:
    spect_data_dict = json.load(fp, cls=MontyDecoder)

    instead of being wrapped into fixtures, test setup/teardown functions or skip's, pytest collection fails, and no tests which could probably still be executed are run.

At least 1 and 3 should be fixed in pymatgen code, so please reopen.

I would recommend you redo the install within a proper virtual env or even better, use Miniconda to do the install

This is absolutely not possible for packaging. Additionally, miniconda is not available for FreeBSD.

running build_ext
copying build/lib.freebsd-13.0-RELEASE-amd64-3.8/pymatgen/optimization/linear_assignment.cpython-38.so -> pymatgen/optimization
copying build/lib.freebsd-13.0-RELEASE-amd64-3.8/pymatgen/util/coord_cython.cpython-38.so -> pymatgen/util
copying build/lib.freebsd-13.0-RELEASE-amd64-3.8/pymatgen/optimization/neighbors.cpython-38.so -> pymatgen/optimization
============================= test session starts ==============================
platform freebsd13 -- Python 3.8.13, pytest-7.1.1, pluggy-0.13.1 -- /usr/local/bin/python3.8
cachedir: .pytest_cache
rootdir: /work/usr/ports/science/py-pymatgen/work-py38/pymatgen-2022.0.17, configfile: setup.cfg
collecting ... collected 1434 items / 7 errors / 2 skipped

==================================== ERRORS ====================================
___ ERROR collecting pymatgen/electronic_structure/tests/test_boltztrap2.py ____
pymatgen/electronic_structure/tests/test_boltztrap2.py:35: in <module>
    vrun = Vasprun(vrunfile, parse_projected_eigen=True)
pymatgen/io/vasp/outputs.py:345: in __init__
    with zopen(filename, "rt") as f:
/usr/local/lib/python3.8/site-packages/monty/io.py:43: in zopen
    return io.open(filename, *args, **kwargs)  # pylint: disable=R1732
E   FileNotFoundError: [Errno 2] No such file or directory: '/work/usr/ports/science/py-pymatgen/work-py38/pymatgen-2022.0.17/pymatgen/util/../../test_files/boltztrap2/vasprun.xml'
_______ ERROR collecting pymatgen/entries/tests/test_computed_entries.py _______
pymatgen/entries/tests/test_computed_entries.py:29: in <module>
    vasprun = Vasprun(filepath)
pymatgen/io/vasp/outputs.py:345: in __init__
    with zopen(filename, "rt") as f:
/usr/local/lib/python3.8/site-packages/monty/io.py:43: in zopen
    return io.open(filename, *args, **kwargs)  # pylint: disable=R1732
E   FileNotFoundError: [Errno 2] No such file or directory: '/work/usr/ports/science/py-pymatgen/work-py38/pymatgen-2022.0.17/pymatgen/util/../../test_files/vasprun.xml'
_______________ ERROR collecting pymatgen/ext/tests/test_cod.py ________________
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:174: in _new_conn
    conn = connection.create_connection(
/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py:72: in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
/usr/local/lib/python3.8/socket.py:918: in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E   socket.gaierror: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:703: in urlopen
    httplib_response = self._make_request(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:386: in _make_request
    self._validate_conn(conn)
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:1040: in _validate_conn
    conn.connect()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:358: in connect
    self.sock = conn = self._new_conn()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:186: in _new_conn
    raise NewConnectionError(
E   urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x8312b2d60>: Failed to establish a new connection: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/requests/adapters.py:440: in send
    resp = conn.urlopen(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:785: in urlopen
    retries = retries.increment(
/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py:592: in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
E   urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.crystallography.net', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x8312b2d60>: Failed to establish a new connection: [Errno 8] Name does not resolve'))

During handling of the above exception, another exception occurred:
pymatgen/ext/tests/test_cod.py:14: in <module>
    website_is_up = requests.get("https://www.crystallography.net").status_code == 200
/usr/local/lib/python3.8/site-packages/requests/api.py:75: in get
    return request('get', url, params=params, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/api.py:61: in request
    return session.request(method=method, url=url, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:529: in request
    resp = self.send(prep, **send_kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:645: in send
    r = adapter.send(request, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/adapters.py:519: in send
    raise ConnectionError(e, request=request)
E   requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.crystallography.net', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x8312b2d60>: Failed to establish a new connection: [Errno 8] Name does not resolve'))
____________ ERROR collecting pymatgen/ext/tests/test_crystalsai.py ____________
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:174: in _new_conn
    conn = connection.create_connection(
/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py:72: in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
/usr/local/lib/python3.8/socket.py:918: in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E   socket.gaierror: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:703: in urlopen
    httplib_response = self._make_request(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:398: in _make_request
    conn.request(method, url, **httplib_request_kw)
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:239: in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
/usr/local/lib/python3.8/http/client.py:1256: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/local/lib/python3.8/http/client.py:1302: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/local/lib/python3.8/http/client.py:1251: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/local/lib/python3.8/http/client.py:1011: in _send_output
    self.send(msg)
/usr/local/lib/python3.8/http/client.py:951: in send
    self.connect()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:205: in connect
    conn = self._new_conn()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:186: in _new_conn
    raise NewConnectionError(
E   urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x83117f730>: Failed to establish a new connection: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/requests/adapters.py:440: in send
    resp = conn.urlopen(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:785: in urlopen
    retries = retries.increment(
/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py:592: in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
E   urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='megnet.crystals.ai', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x83117f730>: Failed to establish a new connection: [Errno 8] Name does not resolve'))

During handling of the above exception, another exception occurred:
pymatgen/ext/tests/test_crystalsai.py:12: in <module>
    website_is_up = requests.get("http://megnet.crystals.ai").status_code == 200
/usr/local/lib/python3.8/site-packages/requests/api.py:75: in get
    return request('get', url, params=params, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/api.py:61: in request
    return session.request(method=method, url=url, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:529: in request
    resp = self.send(prep, **send_kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:645: in send
    r = adapter.send(request, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/adapters.py:519: in send
    raise ConnectionError(e, request=request)
E   requests.exceptions.ConnectionError: HTTPConnectionPool(host='megnet.crystals.ai', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x83117f730>: Failed to establish a new connection: [Errno 8] Name does not resolve'))
_______________ ERROR collecting pymatgen/ext/tests/test_jhu.py ________________
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:174: in _new_conn
    conn = connection.create_connection(
/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py:72: in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
/usr/local/lib/python3.8/socket.py:918: in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E   socket.gaierror: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:703: in urlopen
    httplib_response = self._make_request(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:398: in _make_request
    conn.request(method, url, **httplib_request_kw)
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:239: in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
/usr/local/lib/python3.8/http/client.py:1256: in request
    self._send_request(method, url, body, headers, encode_chunked)
/usr/local/lib/python3.8/http/client.py:1302: in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
/usr/local/lib/python3.8/http/client.py:1251: in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
/usr/local/lib/python3.8/http/client.py:1011: in _send_output
    self.send(msg)
/usr/local/lib/python3.8/http/client.py:951: in send
    self.connect()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:205: in connect
    conn = self._new_conn()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:186: in _new_conn
    raise NewConnectionError(
E   urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x830fdd040>: Failed to establish a new connection: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/requests/adapters.py:440: in send
    resp = conn.urlopen(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:785: in urlopen
    retries = retries.increment(
/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py:592: in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
E   urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='muellergroup.jhu.edu', port=8080): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x830fdd040>: Failed to establish a new connection: [Errno 8] Name does not resolve'))

During handling of the above exception, another exception occurred:
pymatgen/ext/tests/test_jhu.py:20: in <module>
    website_is_up = requests.get("http://muellergroup.jhu.edu:8080").status_code == 200
/usr/local/lib/python3.8/site-packages/requests/api.py:75: in get
    return request('get', url, params=params, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/api.py:61: in request
    return session.request(method=method, url=url, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:529: in request
    resp = self.send(prep, **send_kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:645: in send
    r = adapter.send(request, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/adapters.py:519: in send
    raise ConnectionError(e, request=request)
E   requests.exceptions.ConnectionError: HTTPConnectionPool(host='muellergroup.jhu.edu', port=8080): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x830fdd040>: Failed to establish a new connection: [Errno 8] Name does not resolve'))
_____________ ERROR collecting pymatgen/ext/tests/test_matproj.py ______________
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:174: in _new_conn
    conn = connection.create_connection(
/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py:72: in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
/usr/local/lib/python3.8/socket.py:918: in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
E   socket.gaierror: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:703: in urlopen
    httplib_response = self._make_request(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:386: in _make_request
    self._validate_conn(conn)
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:1040: in _validate_conn
    conn.connect()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:358: in connect
    self.sock = conn = self._new_conn()
/usr/local/lib/python3.8/site-packages/urllib3/connection.py:186: in _new_conn
    raise NewConnectionError(
E   urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x830fa1e20>: Failed to establish a new connection: [Errno 8] Name does not resolve

During handling of the above exception, another exception occurred:
/usr/local/lib/python3.8/site-packages/requests/adapters.py:440: in send
    resp = conn.urlopen(
/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py:785: in urlopen
    retries = retries.increment(
/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py:592: in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
E   urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.materialsproject.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x830fa1e20>: Failed to establish a new connection: [Errno 8] Name does not resolve'))

During handling of the above exception, another exception occurred:
pymatgen/ext/tests/test_matproj.py:31: in <module>
    website_is_up = requests.get("https://www.materialsproject.org").status_code == 200
/usr/local/lib/python3.8/site-packages/requests/api.py:75: in get
    return request('get', url, params=params, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/api.py:61: in request
    return session.request(method=method, url=url, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:529: in request
    resp = self.send(prep, **send_kwargs)
/usr/local/lib/python3.8/site-packages/requests/sessions.py:645: in send
    r = adapter.send(request, **kwargs)
/usr/local/lib/python3.8/site-packages/requests/adapters.py:519: in send
    raise ConnectionError(e, request=request)
E   requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.materialsproject.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x830fa1e20>: Failed to establish a new connection: [Errno 8] Name does not resolve'))
_____________ ERROR collecting pymatgen/vis/tests/test_plotters.py _____________
pymatgen/vis/tests/test_plotters.py:18: in <module>
    with open(os.path.join(test_dir, "LiCoO2_k_xanes.json")) as fp:
E   FileNotFoundError: [Errno 2] No such file or directory: '/work/usr/ports/science/py-pymatgen/work-py38/pymatgen-2022.0.17/pymatgen/util/../../test_files/spectrum_test/LiCoO2_k_xanes.json'
=============================== warnings summary ===============================
pymatgen/electronic_structure/dos.py:14
  /work/usr/ports/science/py-pymatgen/work-py38/pymatgen-2022.0.17/pymatgen/electronic_structure/dos.py:14: DeprecationWarning: Please use `value` from the `scipy.constants` namespace, the `scipy.constants.codata` namespace is deprecated.
    from scipy.constants.codata import value as _cd

pymatgen/core/spectrum.py:15
  /work/usr/ports/science/py-pymatgen/work-py38/pymatgen-2022.0.17/pymatgen/core/spectrum.py:15: DeprecationWarning: Please use `convolve1d` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
    from scipy.ndimage.filters import convolve1d

../../../../../../../usr/local/lib/python3.8/site-packages/past/builtins/misc.py:45
  /usr/local/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    from imp import reload

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
SKIPPED [1] pymatgen/analysis/tests/test_functional_groups.py:19: OpenBabel not installed
SKIPPED [1] pymatgen/io/tests/test_babel.py:18: OpenBabel not installed
!!!!!!!!!!!!!!!!!!! Interrupted: 7 errors during collection !!!!!!!!!!!!!!!!!!!!
=================== 2 skipped, 3 warnings, 7 errors in 5.77s ===================

@shyuep
Copy link
Member

shyuep commented Apr 26, 2022

Please be specific about what data is missing from the distribution. Note that the test files are deliberately not included within the usual pymatgen distribution. The test dir alone is several GB because it contains output files from electronic structure software. It is not possible to include this in an install file (and it is not common practice). If you want the full suite, you can download directly from the Github repo. For network access, you can exclude all tests in the pymatgen/ext folder (this is just using the --exclude options. As far as I know, pymatgen/ext is the only one that communicates on the network.

@AMDmi3
Copy link

AMDmi3 commented Apr 26, 2022

Please be specific about what data is missing from the distribution

The exhaustive log was attached, the files were mentioned right there. For instance,

  • test_files/boltztrap2/vasprun.xml
  • test_files/vasprun.xml
  • test_files/spectrum_test/LiCoO2_k_xanes.json

Note that the test files are deliberately not included within the usual pymatgen distribution. The test dir alone is several GB

This is understandable, but in this case not skipping tests if data files required for them are missing is the problem.

@shyuep
Copy link
Member

shyuep commented Apr 26, 2022

For a code like pymatgen, most of the tests involve an external file of some sort. If we skip all tests that require things in test_files, we will be left with a tiny fraction of the code being tested.

As I said before, testing is meant to be done from the Github full repository, which includes the test files. It is not meant to be done from the distributed wheels or the tar.gz source.

@AMDmi3
Copy link

AMDmi3 commented Apr 26, 2022

If we skip all tests that require things in test_files, we will be left with a tiny fraction of the code being tested.

This is expected, but it is better than nothing, and definitely better than failing for unrelated reason, and requiring investigation from a maintainer like in this case. If introducing proper test skips would be too much work, there probably are other solution, such as failing all the tests early with some informative message, or removing tests from the distribution as well. That would be consistent at the very least.

@shyuep
Copy link
Member

shyuep commented Apr 26, 2022

The tests were never included in the distribution. Go ahead and download the tar.gz from https://pypi.org/project/pymatgen/ and see for yourself. Pretty sure there are no tests in there.

@AMDmi3
Copy link

AMDmi3 commented Apr 27, 2022

Ok, that's true for the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants