"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test_suite/relax_test_loader.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.

relax_test_loader.py  (relax-4.1.3.src.tar.bz2):relax_test_loader.py  (relax-5.0.0.src.tar.bz2)
################################################################################ ################################################################################
# # # #
# Copyright (C) 2011 Edward d'Auvergne # # Copyright (C) 2011,2019 Edward d'Auvergne #
# # # #
# This file is part of the program relax. # # This file is part of the program relax. #
# # # #
# 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 37 skipping to change at line 37
# Python module imports # Python module imports
from unittest import TestLoader, TestSuite from unittest import TestLoader, TestSuite
# relax module imports. # relax module imports.
from status import Status; status = Status() from status import Status; status = Status()
class RelaxTestLoader(TestLoader): class RelaxTestLoader(TestLoader):
"""Replacement TestLoader class.""" """Replacement TestLoader class."""
def loadTestsFromNames(self, names, module=None):
"""Replacement method for handling skipped tests."""
# Get the test names.
testCaseNames = self.getTestCaseNames(module)
# Generate a list of test cases.
case_list = []
for name in names:
# Initialise the test case.
test_case = module(name)
# Skip.
if status.skip_blacklisted_tests and status.skipped_tests and name i
n list(zip(*status.skipped_tests))[0]:
continue
# Append the test case.
case_list.append(test_case)
# Return the test suite.
return self.suiteClass(case_list)
def loadTestsFromTestCase(self, testCaseClass): def loadTestsFromTestCase(self, testCaseClass):
"""Replacement method for skipping tests.""" """Replacement method for skipping tests."""
# A check from the original function. # A check from the original function.
if issubclass(testCaseClass, TestSuite): if issubclass(testCaseClass, TestSuite):
raise TypeError("Test cases should not be derived from TestSuite. Ma ybe you meant to derive from TestCase?") raise TypeError("Test cases should not be derived from TestSuite. Ma ybe you meant to derive from TestCase?")
# Get the test names. # Get the test names.
testCaseNames = self.getTestCaseNames(testCaseClass) testCaseNames = self.getTestCaseNames(testCaseClass)
 End of changes. 2 change blocks. 
1 lines changed or deleted 24 lines changed or added

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