From 6f0cb1b413edb6ab8d137ba2353655d057399bbc Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Sun, 27 Mar 2022 23:45:50 -0400
Subject: [PATCH] Update project for running tests via pytest

---
 pytest.ini                                                  | 4 ++++
 requirements.txt                                            | 2 ++
 tests/connectors/core/{database.py => test_database.py}     | 6 ++++++
 tests/connectors/core/{display.py => test_display.py}       | 0
 tests/connectors/core/{query.py => test_query.py}           | 0
 tests/connectors/core/{tables.py => test_tables.py}         | 0
 tests/connectors/core/{validate.py => test_validate.py}     | 0
 tests/connectors/mysql/{database.py => test_database.py}    | 0
 tests/connectors/mysql/{display.py => test_display.py}      | 0
 tests/connectors/mysql/{query.py => test_query.py}          | 0
 tests/connectors/mysql/{tables.py => test_tables.py}        | 0
 tests/connectors/mysql/{validate.py => test_validate.py}    | 0
 .../connectors/postgresql/{database.py => test_database.py} | 0
 tests/connectors/postgresql/{display.py => test_display.py} | 0
 tests/connectors/postgresql/{query.py => test_query.py}     | 0
 tests/connectors/postgresql/{tables.py => test_tables.py}   | 0
 .../connectors/postgresql/{validate.py => test_validate.py} | 0
 tests/connectors/sqlite/{database.py => test_database.py}   | 0
 tests/connectors/sqlite/{display.py => test_display.py}     | 0
 tests/connectors/sqlite/{query.py => test_query.py}         | 0
 tests/connectors/sqlite/{tables.py => test_tables.py}       | 0
 tests/connectors/sqlite/{validate.py => test_validate.py}   | 0
 22 files changed, 12 insertions(+)
 create mode 100644 pytest.ini
 rename tests/connectors/core/{database.py => test_database.py} (79%)
 rename tests/connectors/core/{display.py => test_display.py} (100%)
 rename tests/connectors/core/{query.py => test_query.py} (100%)
 rename tests/connectors/core/{tables.py => test_tables.py} (100%)
 rename tests/connectors/core/{validate.py => test_validate.py} (100%)
 rename tests/connectors/mysql/{database.py => test_database.py} (100%)
 rename tests/connectors/mysql/{display.py => test_display.py} (100%)
 rename tests/connectors/mysql/{query.py => test_query.py} (100%)
 rename tests/connectors/mysql/{tables.py => test_tables.py} (100%)
 rename tests/connectors/mysql/{validate.py => test_validate.py} (100%)
 rename tests/connectors/postgresql/{database.py => test_database.py} (100%)
 rename tests/connectors/postgresql/{display.py => test_display.py} (100%)
 rename tests/connectors/postgresql/{query.py => test_query.py} (100%)
 rename tests/connectors/postgresql/{tables.py => test_tables.py} (100%)
 rename tests/connectors/postgresql/{validate.py => test_validate.py} (100%)
 rename tests/connectors/sqlite/{database.py => test_database.py} (100%)
 rename tests/connectors/sqlite/{display.py => test_display.py} (100%)
 rename tests/connectors/sqlite/{query.py => test_query.py} (100%)
 rename tests/connectors/sqlite/{tables.py => test_tables.py} (100%)
 rename tests/connectors/sqlite/{validate.py => test_validate.py} (100%)

diff --git a/pytest.ini b/pytest.ini
new file mode 100644
index 0000000..d910476
--- /dev/null
+++ b/pytest.ini
@@ -0,0 +1,4 @@
+[pytest]
+testpaths = tests
+python_files = tests.py test_*.py
+log_level = NOTSET
diff --git a/requirements.txt b/requirements.txt
index 7e7b17c..1267753 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,6 +10,8 @@
  ##
 mysqlclient     # For connecting to mysql.
 pytz            # For datetime shenanigans.
+pytest          # Base Pytest package. Current preferred testing method.
+pytest-xdist    # Additional Pytest features, such as multithreading and looping.
 
 
 ###
diff --git a/tests/connectors/core/database.py b/tests/connectors/core/test_database.py
similarity index 79%
rename from tests/connectors/core/database.py
rename to tests/connectors/core/test_database.py
index 13a47e9..8b1cc07 100644
--- a/tests/connectors/core/database.py
+++ b/tests/connectors/core/test_database.py
@@ -18,3 +18,9 @@ class TestCoreDatabase(unittest.TestCase):
     def setUpClass(cls):
         # Run parent setup logic.
         super().setUpClass()
+
+    def test__create_database__success(self):
+        """"""
+
+    def test__create_database__failure(self):
+        """"""
diff --git a/tests/connectors/core/display.py b/tests/connectors/core/test_display.py
similarity index 100%
rename from tests/connectors/core/display.py
rename to tests/connectors/core/test_display.py
diff --git a/tests/connectors/core/query.py b/tests/connectors/core/test_query.py
similarity index 100%
rename from tests/connectors/core/query.py
rename to tests/connectors/core/test_query.py
diff --git a/tests/connectors/core/tables.py b/tests/connectors/core/test_tables.py
similarity index 100%
rename from tests/connectors/core/tables.py
rename to tests/connectors/core/test_tables.py
diff --git a/tests/connectors/core/validate.py b/tests/connectors/core/test_validate.py
similarity index 100%
rename from tests/connectors/core/validate.py
rename to tests/connectors/core/test_validate.py
diff --git a/tests/connectors/mysql/database.py b/tests/connectors/mysql/test_database.py
similarity index 100%
rename from tests/connectors/mysql/database.py
rename to tests/connectors/mysql/test_database.py
diff --git a/tests/connectors/mysql/display.py b/tests/connectors/mysql/test_display.py
similarity index 100%
rename from tests/connectors/mysql/display.py
rename to tests/connectors/mysql/test_display.py
diff --git a/tests/connectors/mysql/query.py b/tests/connectors/mysql/test_query.py
similarity index 100%
rename from tests/connectors/mysql/query.py
rename to tests/connectors/mysql/test_query.py
diff --git a/tests/connectors/mysql/tables.py b/tests/connectors/mysql/test_tables.py
similarity index 100%
rename from tests/connectors/mysql/tables.py
rename to tests/connectors/mysql/test_tables.py
diff --git a/tests/connectors/mysql/validate.py b/tests/connectors/mysql/test_validate.py
similarity index 100%
rename from tests/connectors/mysql/validate.py
rename to tests/connectors/mysql/test_validate.py
diff --git a/tests/connectors/postgresql/database.py b/tests/connectors/postgresql/test_database.py
similarity index 100%
rename from tests/connectors/postgresql/database.py
rename to tests/connectors/postgresql/test_database.py
diff --git a/tests/connectors/postgresql/display.py b/tests/connectors/postgresql/test_display.py
similarity index 100%
rename from tests/connectors/postgresql/display.py
rename to tests/connectors/postgresql/test_display.py
diff --git a/tests/connectors/postgresql/query.py b/tests/connectors/postgresql/test_query.py
similarity index 100%
rename from tests/connectors/postgresql/query.py
rename to tests/connectors/postgresql/test_query.py
diff --git a/tests/connectors/postgresql/tables.py b/tests/connectors/postgresql/test_tables.py
similarity index 100%
rename from tests/connectors/postgresql/tables.py
rename to tests/connectors/postgresql/test_tables.py
diff --git a/tests/connectors/postgresql/validate.py b/tests/connectors/postgresql/test_validate.py
similarity index 100%
rename from tests/connectors/postgresql/validate.py
rename to tests/connectors/postgresql/test_validate.py
diff --git a/tests/connectors/sqlite/database.py b/tests/connectors/sqlite/test_database.py
similarity index 100%
rename from tests/connectors/sqlite/database.py
rename to tests/connectors/sqlite/test_database.py
diff --git a/tests/connectors/sqlite/display.py b/tests/connectors/sqlite/test_display.py
similarity index 100%
rename from tests/connectors/sqlite/display.py
rename to tests/connectors/sqlite/test_display.py
diff --git a/tests/connectors/sqlite/query.py b/tests/connectors/sqlite/test_query.py
similarity index 100%
rename from tests/connectors/sqlite/query.py
rename to tests/connectors/sqlite/test_query.py
diff --git a/tests/connectors/sqlite/tables.py b/tests/connectors/sqlite/test_tables.py
similarity index 100%
rename from tests/connectors/sqlite/tables.py
rename to tests/connectors/sqlite/test_tables.py
diff --git a/tests/connectors/sqlite/validate.py b/tests/connectors/sqlite/test_validate.py
similarity index 100%
rename from tests/connectors/sqlite/validate.py
rename to tests/connectors/sqlite/test_validate.py
-- 
GitLab