mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Improve the test framework to run for multiple classes defined in a single file. Fixes #5071.
This commit is contained in:
parent
be4b8284c5
commit
ed279cac31
@ -13,6 +13,7 @@ New features
|
||||
Housekeeping
|
||||
************
|
||||
|
||||
| `Issue #5071 <https://redmine.postgresql.org/issues/5071>`_ - Improve the test framework to run for multiple classes defined in a single file.
|
||||
|
||||
Bug fixes
|
||||
*********
|
||||
|
@ -48,7 +48,12 @@ class TestsGeneratorRegistry(ABCMeta):
|
||||
# Avoid registering the BaseDriver itself
|
||||
|
||||
if name != 'BaseTestGenerator' and name != 'BaseFeatureTest':
|
||||
TestsGeneratorRegistry.registry[d['__module__']] = cls
|
||||
# Store/append test classes in 'registry' if test modules has
|
||||
# multiple classes
|
||||
if d['__module__'] in TestsGeneratorRegistry.registry:
|
||||
TestsGeneratorRegistry.registry[d['__module__']].append(cls)
|
||||
else:
|
||||
TestsGeneratorRegistry.registry[d['__module__']] = [cls]
|
||||
|
||||
ABCMeta.__init__(cls, name, bases, d)
|
||||
|
||||
|
@ -150,8 +150,10 @@ def get_suite(module_list, test_server, test_app_client, server_information,
|
||||
|
||||
# Get the each test module and add into list
|
||||
for key, klass in module_list:
|
||||
gen = klass
|
||||
modules.append(gen)
|
||||
# Separate each test class from list of classes and store in modules
|
||||
for item in klass:
|
||||
gen = item
|
||||
modules.append(gen)
|
||||
|
||||
# Set the test client to each module & generate the scenarios
|
||||
for module in modules:
|
||||
|
Loading…
Reference in New Issue
Block a user