Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 2a07536

Browse files
committed
Fixed an issue where path cases in Windows are inconsistent, causing tests to fail.
1 parent d5a202c commit 2a07536

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/tests/test_cases/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# encoding: utf-8
22
# No docstring, so we can test D100
3+
import os
34
import sys
45
from .expected import Expectation
56

@@ -362,5 +363,5 @@ def docstring_ignore_violations_of_pydocstyle_D400_and_PEP8_E501_but_catch_D401(
362363
"""Runs something"""
363364
pass
364365

365-
expect(__file__ if __file__[-1] != 'c' else __file__[:-1],
366+
expect(os.path.normcase(__file__ if __file__[-1] != 'c' else __file__[:-1]),
366367
'D100: Missing docstring in public module')

src/tests/test_definitions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,11 @@ def test_pep257(test_case):
273273
locals=locals(),
274274
fromlist=['expectation'],
275275
level=1)
276-
results = list(check([os.path.join(os.path.dirname(__file__),
277-
'test_cases', test_case + '.py')],
276+
test_case_dir = os.path.normcase(os.path.dirname(__file__))
277+
test_case_file = os.path.join(test_case_dir,
278+
'test_cases',
279+
test_case + '.py')
280+
results = list(check([test_case_file],
278281
select=set(ErrorRegistry.get_error_codes())))
279282
for error in results:
280283
assert isinstance(error, Error)

0 commit comments

Comments
 (0)