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

Running the tests #309

Closed
rahmonov opened this issue Feb 16, 2016 · 5 comments
Closed

Running the tests #309

rahmonov opened this issue Feb 16, 2016 · 5 comments

Comments

@rahmonov
Copy link

Isn't it better to run the tests like python bob_test.py? Without installing a third party pytest

@behrtam
Copy link
Contributor

behrtam commented Feb 16, 2016

Thinking about this (maybe I miss something) using py.test doesn't add any value in our case. The unittest module also offers the option -f, --failfast that acts like -x option of py.test. Also the output looks almost the same.

Normally one would choose py.test because it reduces the needed boiler plate code (but we do use the unittest module) and it is more idiomatic python than the junit (Java) inspired unittest.

So one way would be to rewrite all the tests to the pythonic lighter py.test style or to stick with unittest and rewrite the help page about testing. The big advantage of using a standard library module is that the users don't have to install anything (except python).

@Dog
Copy link
Contributor

Dog commented Feb 16, 2016

The advantage pytest gave is it allowed you to run all tests for all exercises at one time. It helped people figure out what exercise they were on if they forgot, or if old solutions had regressions.

It was implemented by the maintainer that came before me, and I just kept pytest because it was the one they had used.

I also believe unittest has no way of doing failed test first, but that may not be important for the size of our exercises.

@behrtam
Copy link
Contributor

behrtam commented Feb 16, 2016

The failfast option for unittest was added in 2.7.

So maybe we should rewrite TESTS.md to show the unittest way (without 3rd party packages) as the default option and mention pytest as simple possibility to run all tests for all exercises.

@Dog
Copy link
Contributor

Dog commented Feb 20, 2016

To make sure my last comment was understood, there is a difference between fail fast and failed first.

Fail fast may be available in unittest, but it does not support running the failed test first the next time it is run.

@behrtam
Copy link
Contributor

behrtam commented Apr 12, 2016

Okay, so pytest adds the possibility to run the test first that failed in the last run.

Than I think we should rewrite the docs/TEST.md to first mention how to run the tests with the build-in tools and mention pytest (what, how, why) as addition.

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

3 participants