Closed simonw closed 5 years ago
Something like this:
DATABASES = ( ("MySQL", mysqldb), ("PostgreSQL", psycopg2) ) @pytest.mark.parametrized("name,mod...): def test_redact(name, mod): if mod is None: pytest.skip("Skipped {}".format(name))
I could define my own decorator which does the parameterized thing AND the fixture registration:
@test_databases def test_redact(filepath, connection): # ...
I'm very happy with this:
https://github.com/simonw/db-to-sqlite/blob/3d450c00b5350bfd20606271c5fc1d6bc27bf556/tests/test_db_to_sqlite.py#L10-L15
Something like this:
I could define my own decorator which does the parameterized thing AND the fixture registration: