diff --git a/changelog.txt b/changelog.txt index 974bb730c..ebf42da41 100644 --- a/changelog.txt +++ b/changelog.txt @@ -63,6 +63,7 @@ Removed - The signac.common.validate module (#853). - The ``Config`` class (#860). - The ``DictManager`` class (#858). + - The ``signac.testing`` module (#863). Version 1 ========= diff --git a/signac/__init__.py b/signac/__init__.py index 130f79c20..f02334dbe 100644 --- a/signac/__init__.py +++ b/signac/__init__.py @@ -9,7 +9,7 @@ collectively accessible. """ -from . import contrib, errors, sync, testing +from . import contrib, errors, sync from ._synced_collections.backends.collection_json import ( BufferedJSONAttrDict as JSONDict, ) @@ -44,5 +44,4 @@ "JSONDict", "H5Store", "H5StoreManager", - "testing", ] diff --git a/signac/testing.py b/signac/testing.py deleted file mode 100644 index 2bdb91ce7..000000000 --- a/signac/testing.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2019 The Regents of the University of Michigan -# All rights reserved. -# This software is licensed under the BSD 3-Clause License. -"""Functions for initializing workspaces for testing purposes.""" -from itertools import cycle - - -# TODO: This feels like something that should be a test fixture or -# fixture-adjacent, not code that belongs in the main package. -def init_jobs(project, nested=False, listed=False, heterogeneous=False): - """Initialize a dataspace for testing purposes. - - Parameters - ---------- - project : :class:`~signac.Project` - The project where jobs will be added. - nested : bool, optional - If True, included nested state points (Default value = False). - listed : bool, optional - If True, include lists as values of state point parameters (Default - value = False). - heterogeneous : bool, optional - If True, include heterogeneous state point parameters (Default value = - False). - - Returns - ------- - list[:class:`~signac.contrib.job.Job`] - A list containing the initialized jobs. - - """ - jobs_init = [] - vals = [1, 1.0, "1", False, True, None] - if nested: - vals += [{"b": v, "c": 0} if heterogeneous else {"b": v} for v in vals] - if listed: - vals += [[v, 0] if heterogeneous else [v] for v in vals] - if heterogeneous: - for k, v in zip(cycle("ab"), vals): - jobs_init.append(project.open_job({k: v}).init()) - else: - for v in vals: - jobs_init.append(project.open_job(dict(a=v)).init()) - return jobs_init diff --git a/tests/test_project.py b/tests/test_project.py index d43ce33c2..529d23d17 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -3,7 +3,6 @@ # This software is licensed under the BSD 3-Clause License. import gzip import io -import itertools import json import logging import os @@ -2431,21 +2430,6 @@ def test_pickle_jobs_directly(self): assert pickle.loads(pickle.dumps(job)) == job -class TestTestingProjectInitialization(TestProjectBase): - - # Sanity check on all different combinations of inputs - def test_input_args(self): - for nested, listed, het in itertools.product([True, False], repeat=3): - with self.project.temporary_project() as tmp_project: - jobs = signac.testing.init_jobs( - tmp_project, nested=nested, listed=listed, heterogeneous=het - ) - assert len(tmp_project) > 0 - assert len(tmp_project) == len(jobs) - # check that call does not fail: - tmp_project.detect_schema() - - class TestProjectStoreBase(test_h5store.TestH5StoreBase): project_class = signac.Project