Skip to content

Commit

Permalink
Clean up postgres test skipping logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwmsmith committed Feb 3, 2016
1 parent 0dd11c4 commit 7f79471
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions odo/backends/tests/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
from odo import odo, into, resource, drop, discover, convert
from odo.utils import assert_allclose, tmpfile

@pytest.fixture(scope='module')
def pg_ip():
return os.environ.get('POSTGRES_IP', 'localhost')

skip_no_rw_loc = \
pytest.mark.skipif(sys.platform == 'win32' and os.environ.get('POSTGRES_TMP_DIR') is None,
reason=("Requires a read/write location defined by "
"env var POSTGRES_TMP_DIR"))
pytest.mark.skipif(pg_ip() != 'localhost',
reason=("Skipping tests with remote PG server (%s)" % pg_ip()))

names = ('tbl%d' % i for i in itertools.count())
new_schema = object()
Expand Down Expand Up @@ -61,11 +63,6 @@ def complex_csv(tmpdir):
yield CSV(fn, has_header=True)


@pytest.fixture(scope='module')
def pg_ip():
return os.environ.get('POSTGRES_IP', 'localhost')


@pytest.fixture
def url(pg_ip):
return 'postgresql://postgres@{}/test::{}'.format(pg_ip, next(names))
Expand Down

0 comments on commit 7f79471

Please sign in to comment.