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

make test less dependent on pyramid version #312

Merged
merged 1 commit into from
Jul 7, 2015

Conversation

tisdall
Copy link
Contributor

@tisdall tisdall commented Jun 15, 2015

Running my own tests I got a failure on test_basic_resource using py34 and pyramid==1.5.7. The message I got was this:

======================================================================
FAIL: test_basic_resource (cornice.tests.test_resource.TestResource)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/cornice/cornice/tests/test_resource.py", line 119, in test_basic_resource
    self.assertEqual(resp.body, b'test({"name": "gawel"});', resp.body)
AssertionError: b'/**/test({"name": "gawel"});' != b'test({"name": "gawel"});' : b'/**/test({"name": "gawel"});'

----------------------------------------------------------------------

Instead of adding another branch on the if statement for that particular version, I changed the test to capture what we're really looking for... It tests that the string contains 'test({"name": "gawel"})'.

I'm a little confused as to why tox fetches the alpha version of pyramid 1.6 instead of using the latest version found at https://pypi.python.org/pypi/pyramid (which is 1.5.7). I guess because it's the most recent version found at https://pypi.python.org/simple/pyramid/ .

@dairiki
Copy link
Collaborator

dairiki commented Jun 15, 2015

FWIW, the --pre argument fed to pip in the install_command in tox.ini is, I think, what is causing the pre-release version of pyramid to be installed.

@tisdall
Copy link
Contributor Author

tisdall commented Jun 15, 2015

It'd be nice to test against the lastest versions of each major version of pyramid. So, both 1.5.7 and 1.6a . I guess that could be done with further tox environments, but then should that be done for every version of python too? :)

@almet
Copy link
Contributor

almet commented Jul 7, 2015

This looks good to me.

almet added a commit that referenced this pull request Jul 7, 2015
make test less dependent on pyramid version
@almet almet merged commit eff8f6f into Cornices:master Jul 7, 2015
@tisdall
Copy link
Contributor Author

tisdall commented Jul 7, 2015

@ametaireau - should we remove the --pre argument in tox so the tests are run against the latest stable version instead of pre-releases?

@almet
Copy link
Contributor

almet commented Jul 7, 2015

I find it useful to be able to test on pre-releases, isn't it?

@tisdall
Copy link
Contributor Author

tisdall commented Jul 7, 2015

@ametaireau - as I said above, I think it'd be nice to test against the latest version of each major release of pyramid. However, if I had to choose which version is the most important to test against, I'd say it'd be the most recent stable release, no?

You could modify the tox file to test against both the pre-release and the latest stable (maybe those two versions of pyramid are sufficient).

@almet
Copy link
Contributor

almet commented Jul 7, 2015

Yes that would make sense.

@elemoine
Copy link

elemoine commented Jul 7, 2015

You could modify the tox file to test against both the pre-release and the latest stable (maybe those two versions of pyramid are sufficient).

Makes sense to me as well. I like the idea of testing against pre releases to catch issues as early as possible.

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.

4 participants