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

Some tests fail on FreeBSD #494

Closed
yurivict opened this issue Oct 2, 2021 · 0 comments
Closed

Some tests fail on FreeBSD #494

yurivict opened this issue Oct 2, 2021 · 0 comments

Comments

@yurivict
Copy link

yurivict commented Oct 2, 2021

==================================================================================== test session starts =====================================================================================
platform freebsd13 -- Python 3.8.11, pytest-4.6.11, py-1.9.0, pluggy-0.13.1
rootdir: /disk-samsung/freebsd-ports/math/py-PuLP/work-py38/PuLP-2.5.1
plugins: forked-1.0.2, cov-2.9.0, hypothesis-6.14.6, rerunfailures-10.1, timeout-1.4.2, xdist-1.32.0, mock-1.10.4, asyncio-0.10.0, flakes-4.0.1
collected 850 items                                                                                                                                                                          

pulp/tests/test_examples.py .F                                                                                                                                                         [  0%]
pulp/tests/test_pulp.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 18%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssss.....................................................sssssssssssssssssssssssssssssssssssssssssssssssssssss...................... [ 40%]
...............................sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 61%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 83%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss                                       [100%]

========================================================================================== FAILURES ==========================================================================================
______________________________________________________________________________ Examples_DocsTests.test_examples ______________________________________________________________________________

self = <pulp.tests.test_examples.Examples_DocsTests testMethod=test_examples>, examples_dir = '../../examples'

    def test_examples(self, examples_dir="../../examples"):
        import importlib
    
        this_file = os.path.realpath(__file__)
        parent_dir = os.path.dirname(this_file)
        files = os.listdir(os.path.join(parent_dir, examples_dir))
        TMP_dir = "_tmp/"
        if not os.path.exists(TMP_dir):
            os.mkdir(TMP_dir)
        for f_name in files:
            if os.path.isdir(f_name):
                continue
            _f_name = "examples." + os.path.splitext(f_name)[0]
            os.chdir(TMP_dir)
>           importlib.import_module(_f_name)

../pulp/tests/test_examples.py:22: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
../examples/SpongeRollProblem5.py:35: in <module>
    Patterns, morePatterns = subSolve(Patterns, duals)
../examples/CG.py:107: in subSolve
    [_vars[i] * duals[i] for i in Pattern.lenOpts]
../examples/CG.py:107: in <listcomp>
    [_vars[i] * duals[i] for i in Pattern.lenOpts]
../pulp/pulp.py:209: in __mul__
    return LpAffineExpression(self) * other
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 1*Roll_Length_5 + 0, other = None

    def __mul__(self, other):
        e = self.emptyCopy()
        if isinstance(other, LpAffineExpression):
            e.constant = self.constant * other.constant
            if len(other):
                if len(self):
                    raise TypeError("Non-constant expressions cannot be multiplied")
                else:
                    c = self.constant
                    if c != 0:
                        for v, x in other.items():
                            e[v] = c * x
            else:
                c = other.constant
                if c != 0:
                    for v, x in self.items():
                        e[v] = c * x
        elif isinstance(other, LpVariable):
            return self * LpAffineExpression(other)
        else:
            if other != 0:
>               e.constant = self.constant * other
E               TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'

../pulp/pulp.py:933: TypeError
------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------
GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
 --cpxlp /tmp/faef3fec91f34bfe8bb4ea951ce85338-pulp.lp -o /tmp/faef3fec91f34bfe8bb4ea951ce85338-pulp.sol
Reading problem data from '/tmp/faef3fec91f34bfe8bb4ea951ce85338-pulp.lp'...
3 rows, 3 columns, 6 non-zeros
[...]
OPTIMAL SOLUTION FOUND BY LP PREPROCESSOR
Time used:   0.0 secs
Memory used: 0.0 Mb (32525 bytes)
Writing basic solution to '/tmp/dc329261598e4b29aed62776d258e913-pulp.sol'...
====================================================================================== warnings summary ======================================================================================
pulp/tests/test_examples.py::Examples_DocsTests::test_examples
  /disk-samsung/freebsd-ports/math/py-PuLP/work-py38/PuLP-2.5.1/pulp/pulp.py:1313: UserWarning: Spaces are not permitted in the name. Converted to '_'
    warnings.warn("Spaces are not permitted in the name. Converted to '_'")

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============================================================== 1 failed, 107 passed, 742 skipped, 1 warnings in 21.68 seconds ===============================================================
*** Error code 1

Version: 2.5.1
Python-3.8
OS: FreeBSD 13

@yurivict yurivict closed this as completed Apr 6, 2024
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

1 participant