beeware / cricket

A GUI tool for running Python test suites.
BSD 3-Clause "New" or "Revised" License
213 stars 69 forks source link

Fix Str to Byte conversion #43

Closed gopar closed 8 years ago

gopar commented 8 years ago

Function expeceted list of Strings but got bytes instead. This is fix for Py 3.x

So after passing this error, I get this:

from django.test.simple import DjangoTestSuiteRunner
ImportError: No module named 'django.test.simple'

Which makes sense since i'm on 1.9.x and this is pre 1.6 but wondering what can I do to fix this? :)

freakboy3742 commented 8 years ago

Thanks for the patch!

As for the 1.9 problem - the usual approach is to speculatively import the module you want, catch the possible ImportError, and handle that case if it happens. There's and example of this approach here

gopar commented 8 years ago

Ah gotcha.

Out of curiosity, if that example worked and helped with this problem, then why was it removed?

freakboy3742 commented 8 years ago

It was removed because I was thinking that Cricket shouldn't have to support versions of Django that aren't officially supported by the Django core team. In retrospect, that was probably a little premature - in the year since I removed that line, it's become clear to me how many people are still using Django < 1.8, even when it is against the advice of the Django core team. As long as it's not especially onerous (such as in this case), I don't object to the shim being added back in.

gopar commented 8 years ago

Just a note but looks like after this pr Py3 is able to run without problems. ( I only did a quick test run in which I only ran all tests or randomly select 1)

Would have to test more if there are no further Py3 problems