"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test_suite/verification_tests/__init__.py" between
relax-4.1.3.src.tar.bz2 and relax-5.0.0.src.tar.bz2

About: relax allows the study of molecular dynamics through the analysis of experimental NMR data. Organic molecules, proteins, RNA, DNA, sugars, and other biomolecules are all supported.

__init__.py  (relax-4.1.3.src.tar.bz2):__init__.py  (relax-5.0.0.src.tar.bz2)
############################################################################### ###############################################################################
# # # #
# Copyright (C) 2006,2008-2012,2014 Edward d'Auvergne # # Copyright (C) 2006,2008-2012,2014,2019 Edward d'Auvergne #
# # # #
# This file is part of the program relax (http://www.nmr-relax.com). # # This file is part of the program relax (http://www.nmr-relax.com). #
# # # #
# This program is free software: you can redistribute it and/or modify # # This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by # # it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or # # the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. # # (at your option) any later version. #
# # # #
# This program is distributed in the hope that it will be useful, # # This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of # # but WITHOUT ANY WARRANTY; without even the implied warranty of #
skipping to change at line 36 skipping to change at line 36
""" """
# Python module imports. # Python module imports.
from re import search from re import search
from unittest import TestSuite from unittest import TestSuite
# relax module imports. # relax module imports.
from lib.errors import RelaxError from lib.errors import RelaxError
# relax software verification test module imports. # relax software verification test module imports.
from test_suite.formatting import format_test_name
from test_suite.relax_test_loader import RelaxTestLoader as TestLoader from test_suite.relax_test_loader import RelaxTestLoader as TestLoader
from test_suite.verification_tests.library import Library from test_suite.verification_tests.library import Library
from test_suite.verification_tests.status_object import Status_object from test_suite.verification_tests.status_object import Status_object
__all__ = [ __all__ = [
'library', 'library',
'status_object' 'status_object'
] ]
class Verification_test_runner: class Verification_test_runner:
"""Class for executing all of the software verification tests.""" """Class for executing all of the software verification tests."""
def run(self, tests=None, runner=None): def run(self, tests=None, runner=None, list_tests=False):
"""Run the software verification tests. """Run the software verification tests.
@keyword tests: The list of system tests to preform. @keyword tests: The list of system tests to preform.
@type tests: list of str @type tests: list of str
@keyword runner: A test runner such as TextTestRunner. For an exampl @keyword runner: A test runner such as TextTestRunner. For an ex
e of how to write a test runner see the python documentation for TextTestRunner ample of how to write a test runner see the python documentation for TextTestRun
in the python source. ner in the python source.
@type runner: Test runner instance (TextTestRunner, BaseGUITestRun @type runner: Test runner instance (TextTestRunner, BaseGUITes
ner subclass, etc.) tRunner subclass, etc.)
@keyword list_tests: A flag which if True will cause the tests to be
listed rather than executed.
@type list_tests: bool
""" """
# Create an array of test suites (add your new TestCase classes here). # Create an array of test suites (add your new TestCase classes here).
suite_array = [] suite_array = []
# Specific tests. # Specific tests.
for test in tests: for test in tests:
# The entire test class. # The entire test class.
if not search('\.', test): if not search('\.', test):
# Check that the class exists. # Check that the class exists.
skipping to change at line 100 skipping to change at line 103
suite_array.append(TestLoader().loadTestsFromNames([test_name], obj)) suite_array.append(TestLoader().loadTestsFromNames([test_name], obj))
# All tests. # All tests.
if not tests: if not tests:
suite_array.append(TestLoader().loadTestsFromTestCase(Library)) suite_array.append(TestLoader().loadTestsFromTestCase(Library))
suite_array.append(TestLoader().loadTestsFromTestCase(Status_object) ) suite_array.append(TestLoader().loadTestsFromTestCase(Status_object) )
# Group all tests together. # Group all tests together.
full_suite = TestSuite(suite_array) full_suite = TestSuite(suite_array)
# Only list the tests.
if list_tests:
for suite in full_suite._tests:
for test in suite:
print(format_test_name(test.id()))
return True
# Run the test suite. # Run the test suite.
results = runner.run(full_suite) results = runner.run(full_suite)
# Return the status of the tests. # Return the status of the tests.
return results.wasSuccessful() return results.wasSuccessful()
 End of changes. 5 change blocks. 
9 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)