]> 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:28:31 +0000 (16:28 -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

pyproject.toml
test/conftest.py

index cefda245f7e2ab7b82637941f3ea42b60a832e97..963b546ed910591f1fa6d1eec7b317c2bf1bf13b 100644 (file)
@@ -20,7 +20,8 @@ exclude-modules = '^sqlalchemy\.testing'
 
 [tool.pytest.ini_options]
 addopts = "--tb native -v -r sfxX --maxfail=250 -p warnings -p logging --strict-markers"
-python_files = "test/*test_*.py"
+norecursedirs = "examples build doc lib"
+python_files = "test_*.py"
 minversion = "6.2"
 filterwarnings = [
     # NOTE: additional SQLAlchemy specific filters in
index d082f44a19a7ef87a825ac4f59aeb96407f9e54d..b7f2d945cacce6b892323753dcb4cbb56f0aacb0 100755 (executable)
@@ -29,7 +29,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