-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
DO NOT MERGE Python 3 test #19116
DO NOT MERGE Python 3 test #19116
Conversation
corehq/apps/domain/forms.py
Outdated
@@ -1228,8 +1229,8 @@ def _get_uppercase_unicode_regexp(): | |||
upper_group = u"".join(uppers) | |||
return re.compile(upper_group, re.UNICODE) | |||
|
|||
SPECIAL = re.compile(ur"\W", re.UNICODE) | |||
NUMBER = re.compile(ur"\d", re.UNICODE) # are there other unicode numerals? | |||
SPECIAL = re.compile(r"\W", re.UNICODE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E305 expected 2 blank lines after class or function definition, found 1
@nickpell fyi we can't completely delete the touchforms submodule until all the commcare-cloud references are removed. everything is mentioned in https://trello.com/c/jGzPtKKR/120-remove-references-to-touchforms |
@gcapalbo 👍 I'm treating this as an experimental branch, not to be merged |
custom/openclinica/utils.py
Outdated
u'eric_' | ||
>>> mk_oc_username('I3#') | ||
u'I3___' | ||
>>> mk_oc_username('eric.idle@montypython.com') if six.PY3 else mk_oc_username('eric.idle@montypython.com').encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (127 > 115 characters)
u'foo-hint' | ||
>>> XFormBuilder.get_text_id('foo') if six.PY3 else XFormBuilder.get_text_id('foo').encode('utf-8') | ||
'foo-label' | ||
>>> XFormBuilder.get_text_id('foo', ['bar']) if six.PY3 else XFormBuilder.get_text_id('foo', ['bar']).encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (125 > 115 characters)
'foo-label' | ||
>>> XFormBuilder.get_text_id('foo', ['bar']) if six.PY3 else XFormBuilder.get_text_id('foo', ['bar']).encode('utf-8') | ||
'bar/foo-label' | ||
>>> XFormBuilder.get_text_id('foo', ['bar', 'baz']) if six.PY3 else XFormBuilder.get_text_id('foo', ['bar', 'baz']).encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (139 > 115 characters)
'bar/foo-label' | ||
>>> XFormBuilder.get_text_id('foo', ['bar', 'baz']) if six.PY3 else XFormBuilder.get_text_id('foo', ['bar', 'baz']).encode('utf-8') | ||
'bar/baz/foo-label' | ||
>>> XFormBuilder.get_text_id('foo', ['bar', 'baz'], 'choice1') if six.PY3 else XFormBuilder.get_text_id('foo', ['bar', 'baz'], 'choice1').encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (161 > 115 characters)
'bar/baz/foo-label' | ||
>>> XFormBuilder.get_text_id('foo', ['bar', 'baz'], 'choice1') if six.PY3 else XFormBuilder.get_text_id('foo', ['bar', 'baz'], 'choice1').encode('utf-8') | ||
'bar/baz/foo-choice1-label' | ||
>>> XFormBuilder.get_text_id('foo', is_hint=True) if six.PY3 else XFormBuilder.get_text_id('foo', is_hint=True).encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (135 > 115 characters)
u'/data/bar/baz/foo' | ||
>>> XFormBuilder.get_data_ref('foo') if six.PY3 else XFormBuilder.get_data_ref('foo').encode('utf-8') | ||
'/data/foo' | ||
>>> XFormBuilder.get_data_ref('foo', ['bar']) if six.PY3 else XFormBuilder.get_data_ref('foo', ['bar']).encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (127 > 115 characters)
'/data/foo' | ||
>>> XFormBuilder.get_data_ref('foo', ['bar']) if six.PY3 else XFormBuilder.get_data_ref('foo', ['bar']).encode('utf-8') | ||
'/data/bar/foo' | ||
>>> XFormBuilder.get_data_ref('foo', ['bar', 'baz']) if six.PY3 else XFormBuilder.get_data_ref('foo', ['bar', 'baz']).encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (141 > 115 characters)
u'{http://openrosa.org/javarosa}constraintMsg' | ||
>>> xform.get_namespaced('constraint') | ||
u'constraint' | ||
>>> xform.get_namespaced('jr:constraintMsg') if six.PY3 else xform.get_namespaced('jr:constraintMsg').encode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (125 > 115 characters)
@@ -15,13 +15,13 @@ class Migration(migrations.Migration): | |||
migrations.AddField( | |||
model_name='locationtype', | |||
name='_expand_from', | |||
field=models.ForeignKey(related_name='+', db_column=b'expand_from', to='locations.LocationType', null=True, on_delete=models.CASCADE), | |||
field=models.ForeignKey(related_name='+', db_column='expand_from', to='locations.LocationType', null=True, on_delete=models.CASCADE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (145 > 115 characters)
@@ -15,7 +15,7 @@ class Migration(migrations.Migration): | |||
migrations.AlterField( | |||
model_name='xformattachmentsql', | |||
name='xform', | |||
field=models.ForeignKey(to='form_processor.XFormInstanceSQL', to_field=b'form_uuid', on_delete=models.CASCADE), | |||
field=models.ForeignKey(to='form_processor.XFormInstanceSQL', to_field='form_uuid', on_delete=models.CASCADE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (122 > 115 characters)
@@ -21,7 +21,7 @@ class Migration(migrations.Migration): | |||
('referenced_id', models.CharField(max_length=255)), | |||
('referenced_type', models.CharField(max_length=255)), | |||
('relationship', models.PositiveSmallIntegerField(choices=[(0, b'child'), (1, b'extension')])), | |||
('case', models.ForeignKey(to='form_processor.CommCareCaseSQL', to_field=b'case_uuid', db_column=b'case_uuid', db_index=False, on_delete=models.CASCADE)), | |||
('case', models.ForeignKey(to='form_processor.CommCareCaseSQL', to_field='case_uuid', db_column='case_uuid', db_index=False, on_delete=models.CASCADE)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (168 > 115 characters)
@@ -15,7 +15,7 @@ class Migration(migrations.Migration): | |||
migrations.AlterField( | |||
model_name='commcarecaseindexsql', | |||
name='case', | |||
field=models.ForeignKey(to='form_processor.CommCareCaseSQL', db_column=b'case_uuid', to_field=b'case_uuid', on_delete=models.CASCADE), | |||
field=models.ForeignKey(to='form_processor.CommCareCaseSQL', db_column='case_uuid', to_field='case_uuid', on_delete=models.CASCADE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (144 > 115 characters)
@@ -17,7 +17,7 @@ class Migration(migrations.Migration): | |||
fields=[ | |||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | |||
('form_uuid', models.CharField(max_length=255)), | |||
('case', models.ForeignKey(to='form_processor.CommCareCaseSQL', to_field=b'case_uuid', db_column=b'case_uuid', db_index=False, on_delete=models.CASCADE)), | |||
('case', models.ForeignKey(to='form_processor.CommCareCaseSQL', to_field='case_uuid', db_column='case_uuid', db_index=False, on_delete=models.CASCADE)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (168 > 115 characters)
preserve_default=True, | ||
), | ||
migrations.AlterField( | ||
model_name='commcarecaseindexsql', | ||
name='case', | ||
field=models.ForeignKey(related_query_name=b'index', related_name='index_set', to_field=b'case_id', to='form_processor.CommCareCaseSQL', on_delete=models.CASCADE), | ||
field=models.ForeignKey(related_query_name=b'index', related_name='index_set', to_field='case_id', to='form_processor.CommCareCaseSQL', on_delete=models.CASCADE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (174 > 115 characters)
preserve_default=True, | ||
), | ||
# ---- end rename commcarecasesql.case_uuid rename | ||
migrations.AlterField( | ||
model_name='caseattachmentsql', | ||
name='case', | ||
field=models.ForeignKey(related_query_name=b'attachment', related_name='attachment_set', to_field=b'case_id', to='form_processor.CommCareCaseSQL', on_delete=models.CASCADE), | ||
field=models.ForeignKey(related_query_name=b'attachment', related_name='attachment_set', to_field='case_id', to='form_processor.CommCareCaseSQL', on_delete=models.CASCADE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (184 > 115 characters)
preserve_default=True, | ||
), | ||
migrations.AlterField( | ||
model_name='xformattachmentsql', | ||
name='form', | ||
field=models.ForeignKey(related_query_name=b'attachment', related_name='attachment_set', to_field=b'form_id', to='form_processor.XFormInstanceSQL', on_delete=models.CASCADE), | ||
field=models.ForeignKey(related_query_name=b'attachment', related_name='attachment_set', to_field='form_id', to='form_processor.XFormInstanceSQL', on_delete=models.CASCADE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (185 > 115 characters)
@@ -217,7 +217,7 @@ class Migration(migrations.Migration): | |||
migrations.AlterField( | |||
model_name='casetransaction', | |||
name='case', | |||
field=models.ForeignKey(related_query_name=b'transaction', related_name='transaction_set', to_field=b'case_id', to='form_processor.CommCareCaseSQL', on_delete=models.CASCADE), | |||
field=models.ForeignKey(related_query_name=b'transaction', related_name='transaction_set', to_field='case_id', to='form_processor.CommCareCaseSQL', on_delete=models.CASCADE), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (186 > 115 characters)
@@ -20,7 +20,7 @@ class Migration(migrations.Migration): | |||
('section_id', models.CharField(max_length=100, db_index=True)), | |||
('balance', models.IntegerField(default=0)), | |||
('last_modified', models.DateTimeField(auto_now=True)), | |||
('case', models.ForeignKey(to='form_processor.CommCareCaseSQL', to_field=b'case_id', on_delete=models.CASCADE)), | |||
('case', models.ForeignKey(to='form_processor.CommCareCaseSQL', to_field='case_id', on_delete=models.CASCADE)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (127 > 115 characters)
@@ -1,5 +1,6 @@ | |||
from __future__ import absolute_import | |||
from __future__ import unicode_literals | |||
import six |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'six' imported but unused
corehq/util/view_utils.py
Outdated
@@ -10,7 +10,7 @@ | |||
from django.core.exceptions import PermissionDenied | |||
from django.http import Http404 | |||
from django.urls import reverse as _reverse | |||
from django.utils.encoding import smart_bytes | |||
from django.utils.encoding import smart_bytes, smart_text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'django.utils.encoding.smart_bytes' imported but unused
corehq/util/workbook_json/excel.py
Outdated
@@ -1,5 +1,7 @@ | |||
from __future__ import absolute_import | |||
from __future__ import unicode_literals | |||
|
|||
import io |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'io' imported but unused
self.assertItemsEqual([u._id for u in users], | ||
[self.tyrion._id, self.daenerys._id]) | ||
self.assertEqual(set(u._id for u in users), | ||
{self.tyrion._id, self.daenerys._id}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E127 continuation line over-indented for visual indent
corehq/apps/app_manager/xform.py
Outdated
@@ -805,7 +805,7 @@ def add_missing_instances(self, domain): | |||
from corehq.apps.app_manager.suite_xml.post_process.instances import get_all_instances_referenced_in_xpaths | |||
instance_declarations = self.get_instance_ids() | |||
missing_unknown_instances = set() | |||
instances, unknown_instance_ids = get_all_instances_referenced_in_xpaths(domain, [self.render()]) | |||
instances, unknown_instance_ids = get_all_instances_referenced_in_xpaths(domain, [self.render().decode('utf-8')]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (121 > 115 characters)
corehq/apps/hqadmin/views/users.py
Outdated
@@ -260,9 +260,9 @@ def get_context_data(self, **kwargs): | |||
else: | |||
message = _('Unexpected restore response {}: {}. ' | |||
'If you believe this is a bug please report an issue.').format(response.status_code, | |||
response.content) | |||
response.content.decode('utf-8')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (124 > 115 characters)
# StaticIndicators = namedtuple('StaticIndicators', 'name, values, is_legacy, infix') | ||
# | ||
# | ||
# def expected_standard_indicators(no_data=False, include_legacy=True, include_totals=True, case_types=None, limit_ranges=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (128 > 115 characters)
corehq/util/tests/test_teeout.py
Outdated
@@ -17,8 +17,14 @@ def test_tee_output(): | |||
print("testing...") | |||
sys.stderr.write("fail.\n") | |||
raise Error("stop") | |||
eq(fake.stdout.getvalue(), "testing...\n") | |||
eq(fake.stderr.getvalue(), "fail.\n") | |||
stdout_text = fail.stderr.getvalue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'fail'
corehq/util/tests/test_teeout.py
Outdated
eq(fake.stdout.getvalue(), "testing...\n") | ||
eq(fake.stderr.getvalue(), "fail.\n") | ||
stdout_text = fail.stderr.getvalue() | ||
stderr_text = fail.stdout.getvalue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'fail'
For python 3 tests
Might need to restart the build after the docker hub build is finished. It's still queued as I'm writing this.
@nickpell