During synchronizing acra-ee with new changes from acra-ce I met issues with table re-declaration into the base.metadata. Previously all our tests were placed in the tests/test.py and python evaluated classes only once.
Now we have several files with test cases and test_common.py that have base test cases with the declaration of encryptor_table. In most cases, this class is evaluated only once and has all child classes in the same file, or it is imported by other classes that re-declare encryptor_table with extend_existing=True parameter for sa.Table statement.
If we will introduce test_XX.py which imports test_type_aware.py, which uses base test cases from test_common.py and some of them declare encryptor_config on the class level then we should add extend_existing in the all child classes and keep in mind it. Or we can declare into the separate metadata objects (not into the global base.metadata) and clean up after test cases - delete all tables to allow create new one extended without name duplication errors.
During synchronizing acra-ee with new changes from acra-ce I met issues with table re-declaration into the
base.metadata
. Previously all our tests were placed in thetests/test.py
and python evaluated classes only once. Now we have several files with test cases andtest_common.py
that have base test cases with the declaration ofencryptor_table
. In most cases, this class is evaluated only once and has all child classes in the same file, or it is imported by other classes that re-declareencryptor_table
withextend_existing=True
parameter forsa.Table
statement. If we will introducetest_XX.py
which importstest_type_aware.py
, which uses base test cases fromtest_common.py
and some of them declareencryptor_config
on the class level then we should addextend_existing
in the all child classes and keep in mind it. Or we can declare into the separate metadata objects (not into the globalbase.metadata
) and clean up after test cases - delete all tables to allow create new one extended without name duplication errors.Checklist