-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run tests on github actions both for sqlite and postgresql (#260)
- Loading branch information
1 parent
4dc384a
commit 019de7e
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from django.db import connection | ||
|
||
import pytest | ||
|
||
|
||
def needs_postgres(fn): | ||
@pytest.mark.django_db | ||
@pytest.mark.postgresql | ||
@pytest.mark.skipif( | ||
connection.vendor != "postgresql", | ||
reason="This test requires a PostgreSQL database", | ||
) | ||
def wrapper(*args, **kwargs): | ||
return fn(*args, **kwargs) | ||
|
||
return wrapper | ||
|
||
|
||
@needs_postgres | ||
def test_running_with_postgres(): | ||
""" | ||
This is a dummy test to check if our logic of @needs_postgres is correct | ||
and that the setup of GitHub actions is correct too. | ||
""" | ||
assert True | ||
|
||
|
||
# FIXME: add more tests (see https://github.com/UrLab/DocHub/issues/257) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters