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

Compatibility of unit tests with python 2.6.6 #8

Closed
wants to merge 1 commit into from
Closed

Compatibility of unit tests with python 2.6.6 #8

wants to merge 1 commit into from

Conversation

lavie
Copy link

@lavie lavie commented Nov 5, 2013

No description provided.

@richardkiss
Copy link
Owner

I tried pulling this in, but unit tests fail.

======================================================================
ERROR: test_validate (pycoin.test.validate_tx_test.ValidatingTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./pycoin/test/validate_tx_test.py", line 61, in test_validate
    tx_db = { tx.hash(): [tx for tx in block_80971.txs] }
NameError: global name 'tx' is not defined

I don't see how this would work on 2.6.6 either... want to take a second look?

@lavie
Copy link
Author

lavie commented Nov 7, 2013

Sorry about that. Will take a second look.

@lavie lavie closed this Nov 7, 2013
@lavie
Copy link
Author

lavie commented Nov 16, 2013

Well, took that second look. Don't know what I was thinking sending that pull request. :)
In any case, compatibility with 2.6 is trickier than just avoiding the dictionary comprehensions in those tests. There's a whole bunch of stuff from 2.7+ that back-porting to 2.6 turns into somewhat ugly code. Various assert functions that don't exist in 2.6 and some changes that were made to bin2ascii.
If you're interested, I can write those patches. Since it's just test code that seems to be the problem maybe having slightly uglier code is forgivable. :) Let me know.

@richardkiss
Copy link
Owner

After I wrote you, I tried reworking that one line to make it compatible with 2.6. But running the tests found other problems. So I suspect you would have to change much more than just test files.

I'd say give it a try and see if your experience matches my suspicion. I'm leery of making too many uglifying changes to support 2.6, so I would have to see what's required and then judge.

What's your reason for wanting to support 2.6?

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.

2 participants