Skip to content

Commit

Permalink
Make tests runnable from root.
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenchrist committed Mar 24, 2024
1 parent af544a7 commit 79e7ac5
Show file tree
Hide file tree
Showing 11 changed files with 762 additions and 1,191 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]'
pip install flake8
- uses: chartboost/ruff-action@v1
- name: Test with pytest
run: |
# data contract resources are defined relative to tests
cd tests/
pytest
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ pip install --upgrade pip setuptools wheel
pip install -e '.[dev]'
ruff check --fix
ruff format --check
cd tests/
pytest
```

Expand Down
3 changes: 1 addition & 2 deletions datacontract/lint/linters/field_reference_linter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datacontract.model.data_contract_specification import \
DataContractSpecification
from datacontract.model.data_contract_specification import DataContractSpecification
from ..lint import Linter, LinterResult


Expand Down
3 changes: 1 addition & 2 deletions datacontract/lint/linters/primary_field_linter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datacontract.model.data_contract_specification import \
DataContractSpecification
from datacontract.model.data_contract_specification import DataContractSpecification
from ..lint import Linter, LinterResult


Expand Down
3 changes: 1 addition & 2 deletions datacontract/lint/linters/valid_constraints_linter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datacontract.model.data_contract_specification import \
DataContractSpecification, Field
from datacontract.model.data_contract_specification import DataContractSpecification, Field
from ..lint import Linter, LinterResult


Expand Down
Empty file added tests/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest


@pytest.fixture(autouse=True)
def change_test_dir(request, monkeypatch):
monkeypatch.chdir(request.fspath.dirname)
Loading

0 comments on commit 79e7ac5

Please sign in to comment.