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

Pytest problems with test classes containing __init__ #13

Closed
alchemyst opened this issue Oct 22, 2017 · 2 comments
Closed

Pytest problems with test classes containing __init__ #13

alchemyst opened this issue Oct 22, 2017 · 2 comments

Comments

@alchemyst
Copy link
Collaborator

Not all tests are running. I receive the following warnings:

shgo/tests/test__shgo.py::TestFunction
  cannot collect test class 'TestFunction' because it has a __init__ constructor

shgo/tests/test__shgo.py::Test1
  cannot collect test class 'Test1' because it has a __init__ constructor

shgo/tests/test__shgo.py::Test2
  cannot collect test class 'Test2' because it has a __init__ constructor

shgo/tests/test__shgo.py::Test3
  cannot collect test class 'Test3' because it has a __init__ constructor

shgo/tests/test__shgo.py::Test4
  cannot collect test class 'Test4' because it has a __init__ constructor

shgo/tests/test__shgo.py::TestLJ
  cannot collect test class 'TestLJ' because it has a __init__ constructor

shgo/tests/test__shgo.py::TestTable
  cannot collect test class 'TestTable' because it has a __init__ constructor

shgo/tests/test__shgo.py::TestInfeasible
  cannot collect test class 'TestInfeasible' because it has a __init__ constructor

-- Docs: http://doc.pytest.org/en/latest/warnings.html
@Stefan-Endres
Copy link
Owner

These are not tests by themselves, but initiations that run several tests using the same class. I will add decorators to skip these tests.

@Stefan-Endres
Copy link
Owner

The only decorator I could find @pytest.mark.skip(reason="Not a unittest") still produced warnings and did not solve this issue. From http://pytest.readthedocs.io/en/reorganize-docs/new-docs/user/skipping.html there does not appear to be any simple way to skip the warnings. I will look into alternatives, maybe we could use something from the numpy.testing module.

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