From 4d046873c00ce026b5f10ecef8b5a185b361bf43 Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Tue, 28 Feb 2023 21:30:03 -0500
Subject: [PATCH] Create project pytest ini files

---
 django_v2/pytest.ini        | 21 +++++++++++++++++++++
 django_v2/test_app/tests.py |  8 --------
 django_v3/pytest.ini        | 21 +++++++++++++++++++++
 django_v4/pytest.ini        | 21 +++++++++++++++++++++
 4 files changed, 63 insertions(+), 8 deletions(-)
 create mode 100644 django_v2/pytest.ini
 delete mode 100644 django_v2/test_app/tests.py
 create mode 100644 django_v3/pytest.ini
 create mode 100644 django_v4/pytest.ini

diff --git a/django_v2/pytest.ini b/django_v2/pytest.ini
new file mode 100644
index 0000000..6a6e114
--- /dev/null
+++ b/django_v2/pytest.ini
@@ -0,0 +1,21 @@
+[pytest]
+DJANGO_SETTINGS_MODULE = settings.settings
+python_files = tests.py test_*.py
+log_level = NOTSET
+
+
+# Constructed as
+#   {action}:{message}:{category}:{module}:{lineno}
+#
+# For more details, see:
+#   https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+#   https://docs.python.org/3/library/warnings.html#warning-filter
+#   https://stackoverflow.com/questions/57925071/how-do-i-avoid-getting-deprecationwarning-from-inside-dependencies-with-pytest
+filterwarnings =
+    ###
+     # Format is:
+     #   ignore:<regex_str_to_match>:<WarningType>
+     # Regex cannot have ":" character, it seems. Or else it thinks it's parsing the warning type.
+     # Warning must have full path defined if not a standard Python warning
+     # (aka django.utils.deprecation.RemovedInDjango50Warning).
+     ##
diff --git a/django_v2/test_app/tests.py b/django_v2/test_app/tests.py
deleted file mode 100644
index 7b2ee78..0000000
--- a/django_v2/test_app/tests.py
+++ /dev/null
@@ -1,8 +0,0 @@
-"""
-Tests for Django v2.2 test project app.
-"""
-
-# Third-Party Imports.
-from django.test import TestCase
-
-# Create your tests here.
diff --git a/django_v3/pytest.ini b/django_v3/pytest.ini
new file mode 100644
index 0000000..6a6e114
--- /dev/null
+++ b/django_v3/pytest.ini
@@ -0,0 +1,21 @@
+[pytest]
+DJANGO_SETTINGS_MODULE = settings.settings
+python_files = tests.py test_*.py
+log_level = NOTSET
+
+
+# Constructed as
+#   {action}:{message}:{category}:{module}:{lineno}
+#
+# For more details, see:
+#   https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+#   https://docs.python.org/3/library/warnings.html#warning-filter
+#   https://stackoverflow.com/questions/57925071/how-do-i-avoid-getting-deprecationwarning-from-inside-dependencies-with-pytest
+filterwarnings =
+    ###
+     # Format is:
+     #   ignore:<regex_str_to_match>:<WarningType>
+     # Regex cannot have ":" character, it seems. Or else it thinks it's parsing the warning type.
+     # Warning must have full path defined if not a standard Python warning
+     # (aka django.utils.deprecation.RemovedInDjango50Warning).
+     ##
diff --git a/django_v4/pytest.ini b/django_v4/pytest.ini
new file mode 100644
index 0000000..6a6e114
--- /dev/null
+++ b/django_v4/pytest.ini
@@ -0,0 +1,21 @@
+[pytest]
+DJANGO_SETTINGS_MODULE = settings.settings
+python_files = tests.py test_*.py
+log_level = NOTSET
+
+
+# Constructed as
+#   {action}:{message}:{category}:{module}:{lineno}
+#
+# For more details, see:
+#   https://docs.pytest.org/en/stable/how-to/capture-warnings.html
+#   https://docs.python.org/3/library/warnings.html#warning-filter
+#   https://stackoverflow.com/questions/57925071/how-do-i-avoid-getting-deprecationwarning-from-inside-dependencies-with-pytest
+filterwarnings =
+    ###
+     # Format is:
+     #   ignore:<regex_str_to_match>:<WarningType>
+     # Regex cannot have ":" character, it seems. Or else it thinks it's parsing the warning type.
+     # Warning must have full path defined if not a standard Python warning
+     # (aka django.utils.deprecation.RemovedInDjango50Warning).
+     ##
-- 
GitLab