Skip to content

Commit

Permalink
tests: run CTE tests only on postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
ergo committed Oct 23, 2016
1 parent dd93f0a commit 98ace0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"coverage",
"pytest",
"psycopg2",
"pytest-cov"
],
install_requires=[
"sqlalchemy",
Expand Down
2 changes: 1 addition & 1 deletion ziggurat_foundations/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from ziggurat_foundations.models.resource import ResourceMixin
from ziggurat_foundations.models.external_identity import ExternalIdentityMixin

is_mysql = 'mysql' in os.environ.get("DB_STRING", '').lower()
not_postgres = 'postgres' not in os.environ.get("DB_STRING", '').lower()

Base = declarative_base()

Expand Down
4 changes: 2 additions & 2 deletions ziggurat_foundations/tests/test_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

from ziggurat_foundations.tests import (
add_resource, BaseTestCase)
from ziggurat_foundations.tests.conftest import Resource, is_mysql
from ziggurat_foundations.tests.conftest import Resource, not_postgres
from ziggurat_foundations.models.services.resource import ResourceService


class TestResources(BaseTestCase):
@pytest.mark.skipif(is_mysql, reason="requires postgres")
@pytest.mark.skipif(not_postgres, reason="requires postgres")
def test_nesting(self, db_session):
root = add_resource(
db_session, -1, 'root', ordering=1)
Expand Down

0 comments on commit 98ace0c

Please sign in to comment.