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

run_tests returns error #94

Closed
pgkirsch opened this issue Apr 23, 2021 · 2 comments · Fixed by #96
Closed

run_tests returns error #94

pgkirsch opened this issue Apr 23, 2021 · 2 comments · Fixed by #96

Comments

@pgkirsch
Copy link
Contributor

$ ipython run_tests.py 
---------------------------------------------------------------------------
...
...

~/Optimization/gpfit/gpfit/tests/t_examples.py in <module>
     38 EXAMPLE_DIR = os.path.abspath(FILE_DIR + '../../../docs/source/examples')
     39 # use gpkit.tests.helpers.generate_example_tests default: only default solver
---> 40 TESTS = generate_example_tests(EXAMPLE_DIR, [TestExamples])
     41 
     42 

~/Optimization/gpkit/gpkit/tests/helpers.py in generate_example_tests(path, testclasses, solvers, newtest_fn)
     34                 setattr(testclass, name, old_test)  # move to a non-test fn
     35                 delattr(testclass, fn)  # delete the old old_test
---> 36                 for solver in solvers:
     37                     new_name = "test_%s_%s" % (name, solver)
     38                     new_fn = newtest_fn(name, solver, import_dict, path)

TypeError: 'NoneType' object is not iterable

This appears to be caused by a GPkit change.

@bqpd do you remember why that change was made? Do you suggest we pass the solvers into the function or revert this GPkit change?

@bqpd
Copy link
Contributor

bqpd commented Apr 26, 2021

Oh yes, this was added so that the skipsolvers argument could be done for research-model tests:

    solvers = [s for s in settings["installed_solvers"]
               if not skipsolvers or s not in skipsolvers]
    tests = generate_example_tests("", [TestFiles], solvers,
                                   newtest_fn=newtest_fn)

for GPfit you probably don't need to skip solvers, so you can use use settings["installed_solvers"] as the argument?

@pgkirsch
Copy link
Contributor Author

pgkirsch commented Jul 6, 2021

@bqpd sorry forgot to reply but yes this solved it. Will create a PR.

pgkirsch added a commit that referenced this issue Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants