Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/runTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cpp/RAT"]
path = cpp/RAT
url = https://github.com/RascalSoftware/RAT/tree/generated_source
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<username>/python-RAT.git
git clone --recurse-submodules https://github.com/<username>/python-RAT.git
cd python-RAT

And finally create a separate branch to begin work
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down