]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
correct for pytest discovery
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 4 Mar 2022 21:28:31 +0000 (16:28 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 4 Mar 2022 21:35:47 +0000 (16:35 -0500)
Made corrections to the default pytest configuration so that test discovery
runs correctly; previously, a configuration error had the effect of
discovery locating the wrong files if a super-directory of the current
directory were named "test".

Fixes: #7045
Change-Id: I2e1f63a35f80ae3f53008f327d83c8342fa7f2f6
(cherry picked from commit d2815b4ac39b42a38dff4cc21ec100c72b9f3cae)

setup.cfg
test/conftest.py

index 49f829f7257e69919071ece748ff183368a08d40..807ee917059c8b5e5984a650279a570ae41f7c07 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -93,7 +93,8 @@ where = lib
 
 [tool:pytest]
 addopts = --tb native -v -r sfxX --maxfail=250 -p no:warnings -p no:logging
-python_files = test/*test_*.py
+norecursedirs = examples build doc lib
+python_files = test_*.py
 
 [upload]
 sign = 1
index c1c6c8c21be1e98aff9caf58249d634fd864c078..515fff340e04ae1ea899c2e76868be3ef14038c8 100755 (executable)
@@ -32,7 +32,11 @@ if not sys.flags.no_user_site:
     # We check no_user_site to honor the use of this flag.
     sys.path.insert(
         0,
-        os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "lib"),
+        os.path.abspath(
+            os.path.join(
+                os.path.dirname(os.path.abspath(__file__)), "..", "lib"
+            )
+        ),
     )
 
 # use bootstrapping so that test plugins are loaded