Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/test_azure/test_azure_blob_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from parsons import AzureBlobStorage, Table
from parsons.utilities import files
from test.utils import mark_live_test

TEST_ACCOUNT_NAME = os.getenv("PARSONS_AZURE_ACCOUNT_NAME")
TEST_CREDENTIAL = os.getenv("PARSONS_AZURE_CREDENTIAL")
Expand All @@ -16,7 +17,7 @@
TEST_FILE_CONTENTS = "Test"


@unittest.skipIf(not os.getenv("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestAzureBlobStorage(unittest.TestCase):
def setUp(self):
self.azure_blob = AzureBlobStorage(
Expand Down
3 changes: 2 additions & 1 deletion test/test_box/test_box_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from boxsdk.exception import BoxAPIException, BoxOAuthException

from parsons import Box, Table
from test.utils import mark_live_test

"""Prior to running, you should ensure that the relevant environment
variables have been set, e.g. via
Expand All @@ -29,7 +30,7 @@ def generate_random_string(length):
return "".join(random.choice(string.ascii_letters) for i in range(length))


@unittest.skipIf(not os.getenv("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestBoxStorage(unittest.TestCase):
def setUp(self) -> None:
warnings.filterwarnings(action="ignore", message="unclosed", category=ResourceWarning)
Expand Down
4 changes: 2 additions & 2 deletions test/test_civis.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import os
import unittest

from parsons import CivisClient, Table
from test.utils import mark_live_test

# from . import scratch_creds


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestCivisClient(unittest.TestCase):
def setUp(self):
self.civis = CivisClient()
Expand Down
7 changes: 3 additions & 4 deletions test/test_databases/test_dbsync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import tempfile
import unittest
from abc import ABC
Expand All @@ -11,7 +10,7 @@
from parsons.databases.database_connector import DatabaseConnector
from parsons.databases.sqlite import Sqlite
from test.test_databases.fakes import FakeDatabase
from test.utils import assert_matching_tables
from test.utils import assert_matching_tables, mark_live_test

_dir = Path(__file__).parent

Expand Down Expand Up @@ -196,7 +195,7 @@ def initialize_db_connections(self) -> None:

# These tests interact directly with the Postgres database. In order to run, set the
# env to LIVE_TEST='TRUE'.
@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestPostgresDBSync(TestDBSync):
db = Postgres
setup_sql = f"""
Expand All @@ -210,6 +209,6 @@ class TestPostgresDBSync(TestDBSync):

# These tests interact directly with the Postgres database. In order to run, set the
# env to LIVE_TEST='TRUE'.
@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestRedshiftDBSync(TestPostgresDBSync):
db = Redshift
7 changes: 3 additions & 4 deletions test/test_databases/test_mysql.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import os
import unittest

from parsons import MySQL, Table
from parsons.databases.mysql.create_table import MySQLCreateTable
from test.utils import assert_matching_tables
from test.utils import assert_matching_tables, mark_live_test


# These tests interact directly with the MySQL database. To run, set env variable "LIVE_TEST=True"
@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestMySQLLive(unittest.TestCase):
def setUp(self):
self.mysql = MySQL()
Expand Down Expand Up @@ -41,7 +40,7 @@ def test_insert_data(self):


# These tests interact directly with the MySQL database. To run, set env variable "LIVE_TEST=True"
@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestMySQL(unittest.TestCase):
def setUp(self):
self.mysql = MySQL()
Expand Down
4 changes: 2 additions & 2 deletions test/test_databases/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

from parsons import Postgres, Table
from test.utils import assert_matching_tables
from test.utils import assert_matching_tables, mark_live_test

# The name of the schema and will be temporarily created for the tests
TEMP_SCHEMA = "parsons_test"
Expand Down Expand Up @@ -149,7 +149,7 @@ def test_create_statement(self):
# These tests interact directly with the Postgres database


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestPostgresDB(unittest.TestCase):
def setUp(self):
self.temp_schema = TEMP_SCHEMA
Expand Down
4 changes: 2 additions & 2 deletions test/test_databases/test_redshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from testfixtures import LogCapture

from parsons import S3, Redshift, Table
from test.utils import assert_matching_tables, validate_list
from test.utils import assert_matching_tables, mark_live_test, validate_list

# The name of the schema and will be temporarily created for the tests
TEMP_SCHEMA = "parsons_test2"
Expand Down Expand Up @@ -381,7 +381,7 @@ def test_copy_statement_columns(self):
# These tests interact directly with the Redshift database


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestRedshiftDB(unittest.TestCase):
def setUp(self):
self.temp_schema = TEMP_SCHEMA
Expand Down
4 changes: 2 additions & 2 deletions test/test_facebook_ads.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
import unittest

import pytest

from parsons import FacebookAds, Table
from test.utils import mark_live_test

users_table = Table(
[
Expand All @@ -27,7 +27,7 @@
)


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestFacebookAdsIntegration(unittest.TestCase):
def setUp(self):
self.fb_ads = FacebookAds()
Expand Down
Empty file added test/test_geocoder/__init__.py
Empty file.
8 changes: 4 additions & 4 deletions test/test_geocoder/test_census_geocoder.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import os
import unittest
from unittest import mock

import petl
from test_responses import batch_resp, coord_resp, geographies_resp, locations_resp

from parsons import CensusGeocoder, Table
from test.utils import assert_matching_tables
from test.utils import assert_matching_tables, mark_live_test

from .test_responses import batch_resp, coord_resp, geographies_resp, locations_resp

@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")

@mark_live_test
class TestCensusGeocoder(unittest.TestCase):
def setUp(self):
self.cg = CensusGeocoder()
Expand Down
5 changes: 2 additions & 3 deletions test/test_google/test_google_cloud_storage.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import os
import unittest
from pathlib import Path

from google.cloud import storage

from parsons import GoogleCloudStorage, Table
from parsons.utilities import files
from test.utils import assert_matching_tables
from test.utils import assert_matching_tables, mark_live_test

TEMP_BUCKET_NAME = "parsons_test"
TEMP_FILE_NAME = "tmp_file_01.txt"


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestGoogleStorageBuckets(unittest.TestCase):
def setUp(self):
self.cloud = GoogleCloudStorage()
Expand Down
4 changes: 2 additions & 2 deletions test/test_google/test_google_drive.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
import random
import string
import unittest

from parsons import GoogleDrive
from test.utils import mark_live_test

# Test Slides: https://docs.google.com/presentation/d/19I-kicyaJV53KoPNwt77KJL10fHzWFdZ_c2mW4XJaxc


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestGoogleDrive(unittest.TestCase):
def setUp(self):
self.gd = GoogleDrive()
Expand Down
5 changes: 2 additions & 3 deletions test/test_google/test_google_sheets.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import os
import time
import unittest

import gspread
import pytest

from parsons import GoogleSheets, Table
from test.utils import assert_matching_tables
from test.utils import assert_matching_tables, mark_live_test


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestGoogleSheets(unittest.TestCase):
def setUp(self):
self.google_sheets = GoogleSheets()
Expand Down
4 changes: 2 additions & 2 deletions test/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import pytz

from parsons import S3, Table
from test.utils import assert_matching_tables
from test.utils import assert_matching_tables, mark_live_test

# Requires a s3 credentials stored in aws config or env variable
# to run properly.


@unittest.skipIf(not os.environ.get("LIVE_TEST"), "Skipping because not running live test")
@mark_live_test
class TestS3(unittest.TestCase):
def setUp(self):
self.s3 = S3()
Expand Down
Loading