Repository navigation
Test with 2to3 - #56
Conversation
…good since the entire thing is parsed at import time. This is the right way to do this. And of course if and when we do add tests that need to be 2to3'd, if this test fails they're all going to fial too. But it's still nice to have...
…ted 3.1). The tests will only work if you try this on top of my pull request at astropy#56 which adds 2to3 support to the setup.py test command. There are still two tests that fail for me under Python 3, but I know I've fixed that problem in PyFITS's SVN trunk, so I just need to merge that in.
|
One oddity I've noticed here: Before this, |
|
Yes, this would be expected. On Python 2 it's not necessary to do the build_py command at all, and in fact I could just take it out. But for 2to3 it is necessary. I just figure leave it in even for Python 2--there's no harm in it really, and it's more consistent that way. |
There was a problem hiding this comment.
Why is the import not inside of the test itself. This will cause the number of tests to change which is a problem for automated testing frameworks that want to track status from one run to the next (like Pandokia). Would this work?:
def test_run_after_2to3():
try:
from .run_after_2to3 import test_run_after_2to3
except SyntaxError:
helper.pytest.fail("Not running the 2to3'd tests!")
There was a problem hiding this comment.
it could work either way, but I liked it this way because the thing that's being imported is the test itself. That is, we're testing that a test can be tested...if that makes any sense. The number of tests doesn't change, because either way a test called "test_run_after_2to3" gets added to the test collection.
There was a problem hiding this comment.
Ah. I get it. Subtle, but makes sense.
Adds support to the setup.py test command to run 2to3 under python 3.x
…ted 3.1). The tests will only work if you try this on top of my pull request at astropy#56 which adds 2to3 support to the setup.py test command. There are still two tests that fail for me under Python 3, but I know I've fixed that problem in PyFITS's SVN trunk, so I just need to merge that in.
…ted 3.1). The tests will only work if you try this on top of my pull request at astropy#56 which adds 2to3 support to the setup.py test command. There are still two tests that fail for me under Python 3, but I know I've fixed that problem in PyFITS's SVN trunk, so I just need to merge that in.
Adds support to the setup.py test command to run 2to3 under python 3.x
…ted 3.1). The tests will only work if you try this on top of my pull request at astropy#56 which adds 2to3 support to the setup.py test command. There are still two tests that fail for me under Python 3, but I know I've fixed that problem in PyFITS's SVN trunk, so I just need to merge that in.
Add spherical-geometry affiliated package
Adds support for running the tests in Python 3 after they've been run through 2to3. I tried doing this through a subclass of setuptools' builtin test command as discussed in another thread, but it just wasn't working out as I'd hoped. Rather than fight with it, it was faster to keep the code mostly as it is: then adding 2to3 support was simply a matter of ensuring that 2to3 is called first, and that the tests are run out of the 2to3'd build.
As a bonus, I added a test that tests that the tests are 2to3'd :) This was necessary since none of the tests currently in master actually require 2to3.