1+ import os
12from datetime import datetime
23
4+ import pytest
35from classes .backup_archive_database import (
46 BackupArchiveDatabase ,
57 backup_schema_name ,
1012from config .psql import conn , local_engine
1113from sqlalchemy import inspect
1214
15+ pytestmark = pytest .mark .skip (
16+ reason = "Skipping tests. The tests in test_diff_backup are designed for stateful, manual testing."
17+ )
18+
1319
1420class TestDiffBackup :
1521 """
@@ -60,26 +66,38 @@ def test_detail_report(self):
6066 url = diff .detail_report ("vacant_properties" )
6167 print (url )
6268
69+ @pytest .mark .skipif (
70+ not os .getenv ("INTEGRATION_TESTING" ),
71+ reason = "For manual integration testing only. Export INTEGRATION_TESTING=True to run" ,
72+ )
6373 def test_upload_to_gcp (self ):
6474 """test a simple upload to Google cloud"""
6575 bucket = google_cloud_bucket ()
6676 blob = bucket .blob ("test.txt" )
6777 blob .upload_from_string ("test" )
6878
79+ @pytest .mark .skipif (
80+ not os .getenv ("INTEGRATION_TESTING" ),
81+ reason = "For manual integration testing only. Export INTEGRATION_TESTING=True to run" ,
82+ )
6983 def test_send_report_to_slack (self ):
7084 """CAREFUL: if configured, this will send a message to Slack, potentially our prod channel"""
7185 diff = DiffReport ()
7286 diff .report = "This is the report"
7387 diff .send_report_to_slack ()
7488
89+ @pytest .mark .skipif (
90+ not os .getenv ("INTEGRATION_TESTING" ),
91+ reason = "For manual integration testing only. Export INTEGRATION_TESTING=True to run" ,
92+ )
7593 def test_email_report (self ):
7694 """CAREFUL: if configured, this will send email if configured"""
7795 diff = DiffReport ()
7896 diff .report = "This is the report"
7997 diff .email_report ()
8098
8199 def test_is_backup_schema_exists (self ):
82- """test method for whether the backup schema exists """
100+ """test method for whether the backup schema exists"""
83101 if TestDiffBackup .backup .is_backup_schema_exists ():
84102 TestDiffBackup .backup .archive_backup_schema ()
85103 conn .commit ()
@@ -91,8 +109,6 @@ def test_is_backup_schema_exists(self):
91109 conn .commit ()
92110 assert not TestDiffBackup .backup .is_backup_schema_exists ()
93111
94-
95112 def test_backup_tiles_file (self ):
96- """ test backing up the tiles file """
113+ """test backing up the tiles file"""
97114 TestDiffBackup .backup .backup_tiles_file ()
98-
0 commit comments