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

DO NOT MERGE Python 3 test #19116

Closed
wants to merge 718 commits into from
Closed

DO NOT MERGE Python 3 test #19116

wants to merge 718 commits into from

Conversation

millerdev
Copy link
Contributor

@millerdev millerdev commented Jan 11, 2018

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

@millerdev millerdev added Open for review: do not merge A work in progress product/invisible Change has no end-user visible impact labels Jan 11, 2018
@millerdev millerdev changed the title DO NOT MERGE DO NOT MERGE Python 3 test Jan 12, 2018
@@ -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)

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

@gcapalbo
Copy link

gcapalbo commented Aug 8, 2018

@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

@nickpell
Copy link
Contributor

nickpell commented Aug 8, 2018

@gcapalbo 👍 I'm treating this as an experimental branch, not to be merged

This was referenced Aug 26, 2018
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')

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')

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')

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')

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')

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')

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')

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')

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),

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),

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)),

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),

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)),

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),

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),

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),

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),

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)),

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

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

@@ -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

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

@@ -1,5 +1,7 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import io

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})

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

@@ -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')])

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)

@@ -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'))

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):

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)

@millerdev millerdev requested a review from esoergel as a code owner June 9, 2019 18:58
@@ -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()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F821 undefined name 'fail'

eq(fake.stdout.getvalue(), "testing...\n")
eq(fake.stderr.getvalue(), "fail.\n")
stdout_text = fail.stderr.getvalue()
stderr_text = fail.stdout.getvalue()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F821 undefined name 'fail'

@millerdev millerdev closed this May 13, 2020
@millerdev millerdev deleted the dm/py3test branch May 13, 2020 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Open for review: do not merge A work in progress product/invisible Change has no end-user visible impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants