Skip to content

Conversation

Nebelhom
Copy link
Collaborator

Here I used py.test to address issue #168

see also http://pytest.org/latest/goodpractises.html as initially pointed out by @whimboo

@Nebelhom
Copy link
Collaborator Author

@whimboo @davehunt @JarekPs

Ok, this is another approach using python setup.py test to run the tests. Let me know what you think. I think this could replace run_tests.sh altogether.

@Nebelhom
Copy link
Collaborator Author

As a side note, it might be a good idea to have a virtual environment active when trying this. I don't know yet, if it installs something when setup.py test is being called.

If someone has more experience with it, please enlighten me. Thx.

setup.py Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you have generated runtests.py via py.test? If that is the case we should also add the generation code to the repository. If we take this approach I assume we can also delete run_tests.sh?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nebelhom
Copy link
Collaborator Author

@whimboo @davehunt @JarekPs

I followed the guide laid out in the link @whimboo posted earlier (http://pytest.org/latest/goodpractises.html#integration-with-setuptools-test-commands).

I think it should be noted that the use of a venv is advised right at the beginning of the guide (not sure if it is still applicable for this case). Should I write a script that calls setup.py test from inside a virtual environment each time?

Also, how applicable to us is the section on Continuous Integration (http://pytest.org/latest/goodpractises.html#use-tox-and-continuous-integration-servers)

@davehunt
Copy link
Member

I don't understand why we're introducing pytest here...

@davehunt
Copy link
Member

Here's some documentation I found on running a unittest suite under setuptools: http://pythonhosted.org/setuptools/setuptools.html#test-build-package-and-run-a-unittest-suite as we already use unitttest, it shouldn't be too difficult to implement this. I don't think we need to introduce py.test, which is an alternative to unittest. That said, I question how useful this even is...

@ghost
Copy link

ghost commented Nov 26, 2013

@davehunt some alternative for pytest.parametrize would be good for our
tests. It would translate our scenarios into separate testsuites instead of
running one big loop inside of the test.

2013/11/26 Dave Hunt [email protected]

Here's some documentation I found on running a unittest suite under
setuptools:
http://pythonhosted.org/setuptools/setuptools.html#test-build-package-and-run-a-unittest-suiteas we already use unitttest, it shouldn't be too difficult to implement
this. I don't think we need to introduce py.test, which is an alternative
to unittest. That said, I question how useful this even is...


Reply to this email directly or view it on GitHubhttps://github.com//pull/189#issuecomment-29298228
.

jarek@reijutsu:$ fortune
You have Egyptian flu: you're going to be a mummy.
jarek@reijutsu:
$ fortune
You now have Asian Flu.

@whimboo
Copy link
Contributor

whimboo commented May 19, 2014

Shall we get this issue closed or implement an alternative? I would suggest we close it.

@Nebelhom
Copy link
Collaborator Author

@whimboo

I would close it. It does not add anything to our existing setup

@whimboo
Copy link
Contributor

whimboo commented May 22, 2014

Alright. So lets do it then. Thanks!

@whimboo whimboo closed this May 22, 2014
@Nebelhom Nebelhom deleted the issue_168_setuppytest branch March 6, 2015 16:26
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

Successfully merging this pull request may close these issues.

3 participants