diff --git a/.github/workflows/runTests.yml b/.github/workflows/runTests.yml index f04d5926..18c56e8a 100644 --- a/.github/workflows/runTests.yml +++ b/.github/workflows/runTests.yml @@ -21,7 +21,9 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + submodules: true - name: Set up Python version ${{ matrix.version }} uses: actions/setup-python@v4 with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..49c4fbff --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cpp/RAT"] + path = cpp/RAT + url = https://github.com/RascalSoftware/RAT/tree/generated_source diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a4483ce6..87d71142 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ This project targets Python 3.9 or later. Install an appropriate version of Pyth Then create a fork of the python-RAT repo, and clone the fork - git clone https://github.com//python-RAT.git + git clone --recurse-submodules https://github.com//python-RAT.git cd python-RAT And finally create a separate branch to begin work diff --git a/requirements.txt b/requirements.txt index d8702c34..111b39f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ numpy >= 1.20 prettytable >= 3.9.0 -pydantic >= 2.4.0 +pydantic >= 2.4.2 pytest >= 7.4.0 pytest-cov >= 4.1.0 StrEnum >= 0.4.15 \ No newline at end of file diff --git a/tests/test_models.py b/tests/test_models.py index a057f58a..83b01ecd 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -49,23 +49,23 @@ def test_default_names(model: Callable, model_name: str) -> None: class TestModels(object): def test_initialise_with_wrong_type(self, model: Callable) -> None: """When initialising a model with the wrong type for the "name" field, we should raise a ValidationError.""" - with pytest.raises(pydantic.ValidationError, match='Input should be a valid string'): + with pytest.raises(pydantic.ValidationError, match=f'1 validation error for {model.__name__}\nname\n Input should be a valid string'): model(name=1) def test_assignment_with_wrong_type(self, model: Callable) -> None: """When assigning the "name" field of a model with the wrong type, we should raise a ValidationError.""" test_model = model() - with pytest.raises(pydantic.ValidationError, match='Input should be a valid string'): + with pytest.raises(pydantic.ValidationError, match=f'1 validation error for {model.__name__}\nname\n Input should be a valid string'): test_model.name = 1 def test_initialise_with_zero_length_name(self, model: Callable) -> None: """When initialising a model with a zero length name, we should raise a ValidationError.""" - with pytest.raises(pydantic.ValidationError, match='String should have at least 1 characters'): + with pytest.raises(pydantic.ValidationError, match=f'1 validation error for {model.__name__}\nname\n String should have at least 1 character'): model(name='') def test_initialise_with_extra_fields(self, model: Callable) -> None: """When initialising a model with unspecified fields, we should raise a ValidationError.""" - with pytest.raises(pydantic.ValidationError, match='Extra inputs are not permitted'): + with pytest.raises(pydantic.ValidationError, match=f'1 validation error for {model.__name__}\nnew_field\n Extra inputs are not permitted'): model(new_field=1)