mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-01 19:36:54 +00:00
tests: Ensure patched os.getcwd() is an absolute path
`os.getcwd()` returns an absolute path; thus, the patched paths should be absolute as well. This is an incremental change towards removing the `ConfigFileFinder` attributes `.parent` and `.tail` to be localized to `.generate_possible_local_files()`. Without this, the tests fail when moving the patching because `os.path.abspath()` calls `os.getcwd()`, expecting `os.getcwd()` to be an absolute path.
This commit is contained in:
parent
a5aa81e875
commit
98d3d50295
1 changed files with 3 additions and 3 deletions
|
|
@ -48,15 +48,15 @@ def test_cli_config_double_read():
|
|||
|
||||
@pytest.mark.parametrize('cwd,expected', [
|
||||
# Root directory of project
|
||||
('.',
|
||||
(os.path.abspath('.'),
|
||||
[os.path.abspath('setup.cfg'),
|
||||
os.path.abspath('tox.ini')]),
|
||||
# Subdirectory of project directory
|
||||
('src',
|
||||
(os.path.abspath('src'),
|
||||
[os.path.abspath('setup.cfg'),
|
||||
os.path.abspath('tox.ini')]),
|
||||
# Outside of project directory
|
||||
('/',
|
||||
(os.path.abspath('/'),
|
||||
[]),
|
||||
])
|
||||
def test_generate_possible_local_files(cwd, expected):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue