From 8cf0e46bbf51bcf1d95019ce7c4d501e8cc4b7d7 Mon Sep 17 00:00:00 2001 From: turturica Date: Fri, 24 Aug 2018 16:23:50 -0700 Subject: [PATCH] test_package_ordering: Collect *.py, but keep a mix of case for filenames. The test doesn't make sense for Windows, because of its case-insensitivity. --- changelog/3796.bugfix.rst | 2 +- changelog/3854.bugfix.rst | 2 +- testing/python/collect.py | 16 +++++++--------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/changelog/3796.bugfix.rst b/changelog/3796.bugfix.rst index bc590815f..7a115301a 100644 --- a/changelog/3796.bugfix.rst +++ b/changelog/3796.bugfix.rst @@ -1,2 +1,2 @@ Fixed an issue where teardown of fixtures of consecutive sub-packages were executed once, at the end of the outer -package. \ No newline at end of file +package. diff --git a/changelog/3854.bugfix.rst b/changelog/3854.bugfix.rst index 72af08aba..6184f03b6 100644 --- a/changelog/3854.bugfix.rst +++ b/changelog/3854.bugfix.rst @@ -1 +1 @@ -Fixes double collection of tests within packages when the filename starts with a capital letter. \ No newline at end of file +Fixes double collection of tests within packages when the filename starts with a capital letter. diff --git a/testing/python/collect.py b/testing/python/collect.py index 5fe85a012..8f4283e40 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -1630,21 +1630,20 @@ def test_package_ordering(testdir): """ . └── root - ├── check_root.py + ├── Test_root.py ├── __init__.py ├── sub1 - │ ├── check_sub1.py + │ ├── Test_sub1.py │ └── __init__.py └── sub2 └── test - ├── check_sub2.py - └── test_in_sub2.py + └── test_sub2.py """ testdir.makeini( """ [pytest] - python_files=check_*.py + python_files=*.py """ ) root = testdir.mkpydir("root") @@ -1653,10 +1652,9 @@ def test_package_ordering(testdir): sub2 = root.mkdir("sub2") sub2_test = sub2.mkdir("sub2") - root.join("check_root.py").write("def test_1(): pass") - sub1.join("check_sub1.py").write("def test_2(): pass") - sub2_test.join("check_sub2.py").write("def test_3(): pass") - sub2_test.join("test_in_sub2.py").write("def test_4(): pass") + root.join("Test_root.py").write("def test_1(): pass") + sub1.join("Test_sub1.py").write("def test_2(): pass") + sub2_test.join("test_sub2.py").write("def test_3(): pass") # Execute from . result = testdir.runpytest("-v", "-s")