summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2020-01-12 16:26:26 -0800
committerEric N. Vander Weele <ericvw@gmail.com>2020-01-12 23:13:04 -0500
commit98d3d50295c3e686913e4c01ca0de2c523aae33b (patch)
tree86b2e7edeba3a5515cdef686d95b0a11c9084e8e /tests
parenta5aa81e87588ff36560654a5ada13eb87e7e8133 (diff)
downloadflake8-98d3d50295c3e686913e4c01ca0de2c523aae33b.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_config_file_finder.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unit/test_config_file_finder.py b/tests/unit/test_config_file_finder.py
index 44da8d4..c0231f8 100644
--- a/tests/unit/test_config_file_finder.py
+++ b/tests/unit/test_config_file_finder.py
@@ -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):