Skip to content

Commit ef0d353

Browse files
authored
Merge branch 'master' into ci-upload-artifact-codecov
2 parents 98e9486 + f2e6814 commit ef0d353

22 files changed

+376
-586
lines changed

.github/workflows/build.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 📦 Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Set up Python 3.10
11+
uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.10"
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install --upgrade pip
17+
pip install build twine
18+
- name: Building package
19+
run: python3 -m build
20+
- name: Check package with Twine
21+
run: twine check dist/*

.github/workflows/lint.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ jobs:
1515
- name: Install dependencies
1616
run: |
1717
python -m pip install --upgrade pip
18-
pip install ruff tox
19-
- name: Format check using Ruff
20-
run: ruff format --check
18+
pip install tox
2119
- name: Run lint
2220
run: tox
2321
env:

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ repos:
2626
hooks:
2727
- id: ruff
2828
- id: ruff-format
29+
args: [ --check ]

docs/testing/index.rst

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -69,43 +69,3 @@ You can also add extra keyword arguments to the ``execute`` method, such as
6969
'hey': 'hello Peter!'
7070
}
7171
}
72-
73-
74-
Snapshot testing
75-
~~~~~~~~~~~~~~~~
76-
77-
As our APIs evolve, we need to know when our changes introduce any breaking changes that might break
78-
some of the clients of our GraphQL app.
79-
80-
However, writing tests and replicating the same response we expect from our GraphQL application can be a
81-
tedious and repetitive task, and sometimes it's easier to skip this process.
82-
83-
Because of that, we recommend the usage of `SnapshotTest <https://github.com/syrusakbary/snapshottest/>`_.
84-
85-
SnapshotTest lets us write all these tests in a breeze, as it automatically creates the ``snapshots`` for us
86-
the first time the test are executed.
87-
88-
89-
Here is a simple example on how our tests will look if we use ``pytest``:
90-
91-
.. code:: python
92-
93-
def test_hey(snapshot):
94-
client = Client(my_schema)
95-
# This will create a snapshot dir and a snapshot file
96-
# the first time the test is executed, with the response
97-
# of the execution.
98-
snapshot.assert_match(client.execute('''{ hey }'''))
99-
100-
101-
If we are using ``unittest``:
102-
103-
.. code:: python
104-
105-
from snapshottest import TestCase
106-
107-
class APITestCase(TestCase):
108-
def test_api_me(self):
109-
"""Testing the API for /me"""
110-
client = Client(my_schema)
111-
self.assertMatchSnapshot(client.execute('''{ hey }'''))

examples/starwars/tests/snapshots/__init__.py

Whitespace-only changes.

examples/starwars/tests/snapshots/snap_test_query.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)