parameterize tests

This commit is contained in:
Robert Lechte 2020-08-14 13:04:35 +10:00
parent 42d066af58
commit 00f9417571
2 changed files with 15 additions and 36 deletions

View File

@ -46,6 +46,14 @@ custom types/domains | ✔ |Basic support (drop-and-create only, no alter) |
`migra` plays nicely with view/function dependencies, and will drop/create them in the correct order.
<div markdown="block" class="hilighted">
## CI for Databases?
If you like migra, you might also be interested in [DatabaseCI](https://databaseci.com/), a new service I'm building to solve problems with database deployments. [Register your interest](https://databaseci.com/).
</div>
## Endorsements
`migra` was [used to manage the schema that powers PyPI](https://twitter.com/dstufft/status/988410901459034113):
@ -54,20 +62,10 @@ custom types/domains | ✔ |Basic support (drop-and-create only, no alter) |
>- [Donald Stufft](https://twitter.com/dstufft), PyPI maintainer
It's [good for local development](https://news.ycombinator.com/item?id=16676481):
> *I can definitely see Migra is more productive when switching around between schemas in development.*
>- [Mike Bayer](https://twitter.com/zzzeek), SQLAlchemy author
<div markdown="block" class="hilighted">
## CI for Databases?
If you like migra, you might also be interested in [CI for databases](/ci-for-databases), a new service I'm building to solve problems with database deployments. [Register your interest](/ci-for-databases).
</div>
## Development
Migra is developed on [github](https://github.com/djrobstep/migra). Contributions are welcome, get involved!

View File

@ -2,6 +2,7 @@ from __future__ import unicode_literals
import io
import pytest
from pytest import raises
from schemainspect import get_inspector
from sqlbag import S, load_sql_from_file, temporary_database
@ -39,11 +40,6 @@ def test_deps():
do_fixture_test(FIXTURE_NAME)
def test_everything():
for FIXTURE_NAME in ["everything"]:
do_fixture_test(FIXTURE_NAME, with_privileges=True)
def test_partitioning():
for FIXTURE_NAME in ["partitioning"]:
do_fixture_test(FIXTURE_NAME)
@ -79,29 +75,14 @@ def test_singleschema_ext():
do_fixture_test(FIXTURE_NAME, create_extensions_only=True)
def test_privs():
for FIXTURE_NAME in ["privileges"]:
do_fixture_test(FIXTURE_NAME, with_privileges=True)
fixtures = "everything privileges enumdefaults enumdeps extversions seq".split()
# fixtures = [(_, ) for _ in fixtures]
def test_enumdefaults():
for FIXTURE_NAME in ["enumdefaults"]:
do_fixture_test(FIXTURE_NAME, with_privileges=True)
def test_enumdeps():
for FIXTURE_NAME in ["enumdeps"]:
do_fixture_test(FIXTURE_NAME, with_privileges=True)
def test_extversions():
for FIXTURE_NAME in ["extversions"]:
do_fixture_test(FIXTURE_NAME, with_privileges=True)
def test_sequences():
for FIXTURE_NAME in ["seq"]:
do_fixture_test(FIXTURE_NAME, with_privileges=True)
@pytest.mark.parametrize("fixture_name", fixtures)
def test_fixtures(fixture_name):
do_fixture_test(fixture_name, with_privileges=True)
schemainspect_test_role = "schemainspect_test_role"