KOSASIH / Galactic-Chain

Constant passed to unittest assert<Bool> PYL-W1503
Anti-pattern
Major
4 months ago4 months old
Redundant use of assertTrue with constant value True
11        dataset = FederatedDataset(np.random.rand(100, 3, 224, 224), np.random.randint(0, 10, 100))
12        model = load_model()
13        train_model(model, dataset)
14        self.assertTrue(True)15
16    def test_federated_learning_inference(self):
17        model = load_model()
Redundant use of assertTrue with constant value True
25        model = load_model()
26        input_data = torch.randn(1, 3, 224, 224)
27        explainable_ai_inference(model, input_data)
28        self.assertTrue(True)29
30if __name__ == "__main__":
31    unittest.main()
Redundant use of assertTrue with constant value True
19        feature_names = ["input_data_0", "input_data_1", "input_data_2", ...]
20        explain_model(model, input_data)
21        visualize_shap_values(shap_values, feature_names)
22        self.assertTrue(True)23
24    def test_explainable_ai_inference(self):
25        model = load_model()
Redundant use of assertTrue with constant value True
18        teacher = EdgeAIModel()
19        student = EdgeAIModel()
20        model_knowledge_distillation(student, teacher, dataset)
21        self.assertTrue(True)22
23if __name__ == "__main__":
24    unittest.main()
Redundant use of assertTrue with constant value True
11    def test_model_pruning(self):
12        model = load_model()
13        model_pruning(model)
14        self.assertTrue(True)15
16    def test_model_knowledge_distillation(self):
17        dataset = EdgeAIDataset(np.random.rand(100, 3, 224, 224), np.random.randint(0, 10, 100))