Skip to content

#640: Refactored generic tests python3#645

Open
sgn4sangar wants to merge 12 commits into
masterfrom
refactor/640_generic_tests_python3
Open

#640: Refactored generic tests python3#645
sgn4sangar wants to merge 12 commits into
masterfrom
refactor/640_generic_tests_python3

Conversation

@sgn4sangar
Copy link
Copy Markdown
Contributor

relates to #640
generic tests for python3 alone

this branch is branched out from refactor/640_bring_db_obs_in_gen_lang_tests

Comment on lines +222 to +226
CREATE PYTHON3 SET SCRIPT set_returns_has_empty_input(a double)
RETURNS boolean AS
def run(ctx):
return bool(ctx.x is None)
/
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Duplication, see line 120.

'''))

self.query(udf.fixindent('''
CREATE PYTHON3 SET SCRIPT set_emits_has_empty_input(a double)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Duplication, see line 128

'''))

self.query(udf.fixindent('''
CREATE PYTHON3 SCALAR SCRIPT performance_map_characters(text VARCHAR(1000))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Duplicate version of this UDF is in file performance.py. But with the current test-framework it can't be moved into a common file. So lets keep it as is for now.

'''))

self.query(udf.fixindent('''
CREATE PYTHON3 SET SCRIPT performance_reduce_characters(w CHAR(1), c INTEGER)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Duplicate version of this UDF is in file performance.py. But with the current test-framework it can't be moved into a common file. So lets keep it as is for now.

from exasol_python_test_framework import exatest


class DynamicOutputCreateScript(udf.TestCase):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The tests check that the UDFs were created. Maybe rename then to something like:

DynamicOutputUDFsExistInExaAllScripts

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The UDFs in the test file are created 12x. Once for each test class. Why not doing something similar as in combinations.py: Create a common base class _Python3UdfSetup where create all UDFs and then inherit from this class.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The 5 UDFs in this file are created 25x, once for each class.
What is most curious here that there is a common base class _Python3UdfSetup which creates the UDFs, but the derived class declare the UDFs again.

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