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.

This commit is contained in:
turturica 2018-08-24 16:23:50 -07:00
parent f0226e9329
commit 8cf0e46bbf
3 changed files with 9 additions and 11 deletions

View File

@ -1,2 +1,2 @@
Fixed an issue where teardown of fixtures of consecutive sub-packages were executed once, at the end of the outer Fixed an issue where teardown of fixtures of consecutive sub-packages were executed once, at the end of the outer
package. package.

View File

@ -1 +1 @@
Fixes double collection of tests within packages when the filename starts with a capital letter. Fixes double collection of tests within packages when the filename starts with a capital letter.

View File

@ -1630,21 +1630,20 @@ def test_package_ordering(testdir):
""" """
. .
root root
check_root.py Test_root.py
__init__.py __init__.py
sub1 sub1
check_sub1.py Test_sub1.py
__init__.py __init__.py
sub2 sub2
test test
check_sub2.py test_sub2.py
test_in_sub2.py
""" """
testdir.makeini( testdir.makeini(
""" """
[pytest] [pytest]
python_files=check_*.py python_files=*.py
""" """
) )
root = testdir.mkpydir("root") root = testdir.mkpydir("root")
@ -1653,10 +1652,9 @@ def test_package_ordering(testdir):
sub2 = root.mkdir("sub2") sub2 = root.mkdir("sub2")
sub2_test = sub2.mkdir("sub2") sub2_test = sub2.mkdir("sub2")
root.join("check_root.py").write("def test_1(): pass") root.join("Test_root.py").write("def test_1(): pass")
sub1.join("check_sub1.py").write("def test_2(): pass") sub1.join("Test_sub1.py").write("def test_2(): pass")
sub2_test.join("check_sub2.py").write("def test_3(): pass") sub2_test.join("test_sub2.py").write("def test_3(): pass")
sub2_test.join("test_in_sub2.py").write("def test_4(): pass")
# Execute from . # Execute from .
result = testdir.runpytest("-v", "-s") result = testdir.runpytest("-v", "-s")