diff --git a/conflowgen/application/repositories/random_seed_store_repository.py b/conflowgen/application/repositories/random_seed_store_repository.py index 70e947e4..21e76e97 100644 --- a/conflowgen/application/repositories/random_seed_store_repository.py +++ b/conflowgen/application/repositories/random_seed_store_repository.py @@ -3,8 +3,6 @@ import typing import time -from unicodedata import name - from conflowgen.application.models.random_seed_store import RandomSeedStore @@ -27,13 +25,11 @@ def get_random_seed(self, seed_name: str, log_loading_process: bool = False) -> random_seed_store.save() if log_loading_process: self.logger.debug(f"Overwrite seed {previous_seed} with {random_seed} for '{seed_name}'") - return random_seed else: # there is a previous seed and we should re-use it random_seed = random_seed_store.random_seed if log_loading_process: self.logger.debug(f"Re-use seed {random_seed} for '{seed_name}'") - return random_seed else: # there is no previous seed available, enter the current seed and return its value random_seed = self._get_random_seed() @@ -44,7 +40,7 @@ def get_random_seed(self, seed_name: str, log_loading_process: bool = False) -> ) if log_loading_process: self.logger.debug(f"Randomly set seed {random_seed} for '{seed_name}'") - return random_seed + return random_seed @staticmethod def _get_random_seed() -> int: diff --git a/conflowgen/tests/application/repositories/test_random_seed_store_repository.py b/conflowgen/tests/application/repositories/test_random_seed_store_repository.py index 5488759d..5f0e0208 100644 --- a/conflowgen/tests/application/repositories/test_random_seed_store_repository.py +++ b/conflowgen/tests/application/repositories/test_random_seed_store_repository.py @@ -1,8 +1,6 @@ import time import unittest -import pytest - from conflowgen.application.models.random_seed_store import RandomSeedStore from conflowgen.application.repositories.random_seed_store_repository import RandomSeedStoreRepository from conflowgen.tests.substitute_peewee_database import setup_sqlite_in_memory_db diff --git a/conflowgen/tests/flow_generator/test_distribution_approximator.py b/conflowgen/tests/flow_generator/test_distribution_approximator.py index 9d516ca7..01b435ea 100644 --- a/conflowgen/tests/flow_generator/test_distribution_approximator.py +++ b/conflowgen/tests/flow_generator/test_distribution_approximator.py @@ -7,7 +7,7 @@ from conflowgen.application.models.random_seed_store import RandomSeedStore from conflowgen.tools.distribution_approximator import DistributionApproximator, SamplerExhaustedException -from substitute_peewee_database import setup_sqlite_in_memory_db +from conflowgen.tests.substitute_peewee_database import setup_sqlite_in_memory_db class TestDistributionApproximator(unittest.TestCase):