Skip to content

Commit

Permalink
bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Aug 8, 2024
1 parent 785a72b commit 2589729
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
39 changes: 39 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
Changes
=======

1.16.0
------

Added custom async ``TestCase`` subclasses, to help with testing.

For example ``AsyncTransactionTest``, which wraps each test in a transaction
automatically:

.. code-block:: python
class TestBandEndpoint(AsyncTransactionTest):
async def test_band_response(self):
"""
Make sure the endpoint returns a 200.
"""
# This data automatically gets removed from the database when the
# test finishes:
band = Band({Band.name: "Pythonistas"})
await band.save()
# Using an API testing client, like httpx:
response = await client.get(f"/bands/{band.id}/")
self.assertEqual(response.status_code, 200)
And ``AsyncTableTest``, which automatically creates and drops tables:

.. code-block:: python
class TestBand(AsyncTableTest):
# These tables automatically get created and dropped:
tables = [Band]
async def test_band(self):
...
-------------------------------------------------------------------------------

1.15.0
------

Expand Down
2 changes: 1 addition & 1 deletion piccolo/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__VERSION__ = "1.15.0"
__VERSION__ = "1.16.0"
4 changes: 2 additions & 2 deletions piccolo/testing/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TableTest(TestCase):
class TestBand(TableTest):
tables = [Band]
def test_example(self):
def test_band(self):
...
""" # noqa: E501
Expand All @@ -49,7 +49,7 @@ class AsyncTableTest(IsolatedAsyncioTestCase):
class TestBand(AsyncTableTest):
tables = [Band]
async def test_example(self):
async def test_band(self):
...
"""
Expand Down

0 comments on commit 2589729

Please sign in to comment.