Skip to content

Commit

Permalink
Move test support to root of model_signing. (sigstore#252)
Browse files Browse the repository at this point in the history
Since we will need to share some of the models with other directories
besides serialization, the only way to achieve this without duplication
is to have `conftest.py` in the root testing directory. And, when moving
that, we also need to move `test_support.py` which defines useful
constants used both in tests and in `conftest.py`.

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
  • Loading branch information
mihaimaruseac authored Jul 24, 2024
1 parent 19a1d45 commit 6f01724
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import pytest

from model_signing.serialization import test_support
from model_signing import test_support


def pytest_addoption(parser):
Expand Down
16 changes: 9 additions & 7 deletions model_signing/serialization/serialize_by_file_shard_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for shard serializers.
NOTE: This test uses a golden setup to compute digest of several test
models. If the golden tests are failing, regenerate the golden files with
pytest model_signing/ --update_goldens
"""

import dataclasses
import pathlib
import pytest
Expand All @@ -20,13 +28,7 @@
from model_signing.hashing import memory
from model_signing.manifest import manifest
from model_signing.serialization import serialize_by_file_shard
from model_signing.serialization import test_support


# NOTE: This test uses a golden setup to compute digest of several test
# models. If the golden tests are failing, regenerate the golden files with
#
# pytest model_signing/serialization/ --update_goldens
from model_signing import test_support


class TestDigestSerializer:
Expand Down
16 changes: 9 additions & 7 deletions model_signing/serialization/serialize_by_file_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Tests for file serializers.
NOTE: This test uses a goldens setup to compute digest of several test
models. If the golden tests are failing, regenerate the golden files with
pytest model_signing/ --update_goldens
"""

import os
import pathlib
import pytest
Expand All @@ -20,13 +28,7 @@
from model_signing.hashing import memory
from model_signing.manifest import manifest
from model_signing.serialization import serialize_by_file
from model_signing.serialization import test_support


# NOTE: This test uses a goldens setup to compute digest of several test
# models. If the golden tests are failing, regenerate the golden files with
#
# pytest model_signing/serialization/ --update_goldens
from model_signing import test_support


class TestDigestSerializer:
Expand Down
File renamed without changes.

0 comments on commit 6f01724

Please sign in to comment.