Skip to content

Commit

Permalink
[VCQ-118] Change unittest.TestCase to MyTestCase where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
nilfm99 committed Feb 14, 2024
1 parent 307e182 commit 0cef35d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions python/test/feature_assembler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
from vmaf.core.feature_assembler import FeatureAssembler
from vmaf.core.feature_extractor import VmafFeatureExtractor, FeatureExtractor, \
MomentFeatureExtractor
from vmaf.tools.misc import MyTestCase

from test.testutil import set_default_576_324_videos_for_testing


class FeatureAssemblerTest(unittest.TestCase):
class FeatureAssemblerTest(MyTestCase):

def tearDown(self):
if hasattr(self, 'fassembler'):
self.fassembler.remove_results()
pass
super().tearDown()

def test_get_fextractor_subclasses(self):
fextractor_subclasses = FeatureExtractor.get_subclasses_recursively()
Expand Down Expand Up @@ -125,7 +126,7 @@ def test_feature_assembler_selected_atom_feature(self):
_ = results[0]['VMAF_feature_adm_score']


class FeatureAssemblerUnitTest(unittest.TestCase):
class FeatureAssemblerUnitTest(MyTestCase):

def test_feature_assembler_get_fextractor_instance(self):
ref_path, dis_path, asset, asset_original = set_default_576_324_videos_for_testing()
Expand Down
9 changes: 3 additions & 6 deletions python/test/local_explainer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@
from vmaf.core.train_test_model import SklearnRandomForestTrainTestModel, \
MomentRandomForestTrainTestModel
from vmaf.routine import read_dataset
from vmaf.tools.misc import import_python_file
from vmaf.tools.misc import import_python_file, MyTestCase

__copyright__ = "Copyright 2016-2020, Netflix, Inc."
__license__ = "BSD+Patent"


class LocalExplainerTest(unittest.TestCase):

def setUp(self):
pass
class LocalExplainerTest(MyTestCase):

def tearDown(self):
if hasattr(self, 'runner'):
self.runner.remove_results()
pass
super().tearDown()

def test_explain_train_test_model(self):

Expand Down
4 changes: 3 additions & 1 deletion python/test/result_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,10 @@ def test_from_xml_from_json_and_aggregation(self):
assert combined_result.result_dict[key][len(combined_result.result_dict[key]) - 1] == results[1].result_dict[key][len(results[1].result_dict[key]) - 1]


class ScoreAggregationTest(unittest.TestCase):
class ScoreAggregationTest(MyTestCase):

def setUp(self):
super().setUp()

ref_path = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_0_0.yuv")
dis_path = VmafConfig.test_resource_path("yuv", "checkerboard_1920_1080_10_3_1_0.yuv")
Expand Down Expand Up @@ -333,6 +334,7 @@ def setUp(self):
def tearDown(self):
if hasattr(self, 'runner'):
self.runner.remove_results()
super().tearDown()

def test_to_score_str(self):

Expand Down

0 comments on commit 0cef35d

Please sign in to comment.