pysat
pysat copied to clipboard
How to run / add to tests?
Hi,
Sorry, I don't know a lot about making Python packages.
I wanted to add some tests for some code I was adding, but I wasn't sure how the tests are structured in the package. Should 'tests' made of TestCases? I had a google and found: https://python-packaging.readthedocs.io/en/latest/testing.html , but I don't think that's what's going on.
Thanks for your question! Actually, it's a shame that there are (almost) no tests in PySAT. :) If you want to prepare one, just create a Python file in tests/
. Running $ pytest
in the root of the project should do the trick, i.e. it will run every test in that directory. (For that, make sure you have the pytest
package installed, e.g. from pip.)
I forgot to mention that there is one example test in tests
, which you may want to follow.
@alexeyignatiev Is this task still relevant? I can help with more tests, including using Hypothesis. Also I can setup & check whole codebase with Ruff linter.
@dulanov, adding proper testing functionality is definitely still relevant. So your contribution here would be more than welcome! 🙂