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

19 tests fail #861

Closed
yurivict opened this issue Apr 9, 2023 · 6 comments
Closed

19 tests fail #861

yurivict opened this issue Apr 9, 2023 · 6 comments

Comments

@yurivict
Copy link

yurivict commented Apr 9, 2023

See log here.

Version: 1.2.0
Python-3.9
FreeBSD 13.1

@newville
Copy link
Member

newville commented Apr 9, 2023

@yurivict Hm, our tests all pass with Python 3.9 (and have for a long time). See these results.

Your log suggests that a great many (perhaps all - I may not have read the entire log closely) of the failures you see are associated with the error message:

  AttributeError: module 'dill' has no attribute 'dumps'

which means that a) there is an importable dill module, and b) it does not have a dumps function. Our code does assume that if dill imports, then calling dill.dumps() should work. The "basic usage" section of the dill documentation describes using dill.dumps() in its first use of dill, so I doubt we will change that assumption.

It seems more likely to me that there is something wrong with the installation of dill in your Python environment.
I don't know why that would be the case.

@yurivict
Copy link
Author

yurivict commented Apr 9, 2023

Please note that pyproject.toml doesn't list dill in requires.

@yurivict
Copy link
Author

yurivict commented Apr 9, 2023

The ```dill`` module was in fact broken. Updating it corrected all errors, except for this one:

=============================================================================================== FAILURES ================================================================================================
_________________________________________________________________________________________ test_Model_get_state __________________________________________________________________________________________

gmodel = <lmfit.Model: Model(gaussian)>

    def test_Model_get_state(gmodel):
        """Test for Model class function _get_state."""
        out = gmodel._get_state()
    
        assert isinstance(out, tuple)
        assert out[1] == out[2] is None
>       assert (out[0][1] is not None) == lmfit.jsonutils.HAS_DILL
E       AssertionError: assert (<function gaussian at 0x969ea8a60> is not None) == False
E        +  where False = <module 'lmfit.jsonutils' from '/usr/ports/math/py-lmfit/work-py39/lmfit-1.2.0/lmfit/jsonutils.py'>.HAS_DILL
E        +    where <module 'lmfit.jsonutils' from '/usr/ports/math/py-lmfit/work-py39/lmfit-1.2.0/lmfit/jsonutils.py'> = lmfit.jsonutils

tests/test_model.py:206: AssertionError

@newville
Copy link
Member

newville commented Apr 9, 2023

@yurivict That error still seems related to dill. That test passes all our CI on all versions and platforms we test on.
Yes, dill is not listed in requirements.txt, because it is not required by lmfit. If it is installed, it might be used (and be expected to work correctly).

We really can not guarantee that our unit tests pass for everyone on every system and environment. That is not actually the purpose of our tests (nor is it really the purpose or promise of any test framework). We try to be helpful to anyone using our code, but we also are going to have a default view that tests that pass in our test environments but fail on some particular system or environment mean that environment is faulty.

Please use the results from running our tests on your environment as a test your environment.

@yurivict
Copy link
Author

yurivict commented Apr 9, 2023

lmfit.jsonutils.HAS_DILL is False, while the latest version of dill (py39-dill-0.3.6_1) is installed.
This seems to be wrong.

@newville
Copy link
Member

newville commented Apr 9, 2023

@yurivict Well, the code there (see

) reads:

try:
    import dill
    HAS_DILL = True
except ImportError:
    HAS_DILL = False

if HAS_DILL is False, then there was an ImportError with import dill.

Again, all of our tests pass on all the systems and all of the test environments. A failure on a different environment strongly suggests a problem with that environment.

This really is not an issue with lmfit. You ignored all of our requests and actual requirements for how to submit an issue and continue to suggest there is a problem here. We have been exceedingly polite even in the face of your inability to follow our request or reason about debugging your system.

@newville newville closed this as completed Apr 9, 2023
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

2 participants