From 75052056b87cc42d824fa4cc375c80941d073e7a Mon Sep 17 00:00:00 2001 From: Lembrun Date: Wed, 10 Mar 2021 10:36:14 +0100 Subject: Replaced tmpdir fixture by tmp_path in test/unit/mainwindow --- tests/unit/mainwindow/test_prompt.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/mainwindow/test_prompt.py b/tests/unit/mainwindow/test_prompt.py index f8d4cdee6..ceb62902f 100644 --- a/tests/unit/mainwindow/test_prompt.py +++ b/tests/unit/mainwindow/test_prompt.py @@ -53,26 +53,26 @@ class TestFileCompletion: (2, 'next', 'a'), (2, 'prev', 'b'), ]) - def test_simple_completion(self, tmpdir, get_prompt, steps, where, + def test_simple_completion(self, tmp_path, get_prompt, steps, where, subfolder): """Simply trying to tab through items.""" - testdir = tmpdir / 'test' + testdir = tmp_path / 'test' for directory in 'abc': - (testdir / directory).ensure(dir=True) + (testdir / directory).mkdir(exist_ok=True,parents=True) prompt = get_prompt(str(testdir) + os.sep) for _ in range(steps): prompt.item_focus(where) - assert prompt._lineedit.text() == str(testdir / subfolder) + assert prompt._lineedit.text() == str((testdir / subfolder).resolve()) - def test_backspacing_path(self, qtbot, tmpdir, get_prompt): + def test_backspacing_path(self, qtbot, tmp_path, get_prompt): """When we start deleting a path we want to see the subdir.""" - testdir = tmpdir / 'test' + testdir = tmp_path / 'test' for directory in ['bar', 'foo']: - (testdir / directory).ensure(dir=True) + (testdir / directory).mkdir(exist_ok=True,parents=True) prompt = get_prompt(str(testdir / 'foo') + os.sep) -- cgit v1.2.3-54-g00ecf From b84ef9b299ec1639ddf79ab900b670a96d71d9f2 Mon Sep 17 00:00:00 2001 From: Lembrun Date: Wed, 10 Mar 2021 21:00:17 +0100 Subject: Added whitespaces --- tests/unit/mainwindow/test_prompt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/mainwindow/test_prompt.py b/tests/unit/mainwindow/test_prompt.py index ceb62902f..5528a9bb9 100644 --- a/tests/unit/mainwindow/test_prompt.py +++ b/tests/unit/mainwindow/test_prompt.py @@ -58,7 +58,7 @@ class TestFileCompletion: """Simply trying to tab through items.""" testdir = tmp_path / 'test' for directory in 'abc': - (testdir / directory).mkdir(exist_ok=True,parents=True) + (testdir / directory).mkdir(exist_ok=True, parents=True) prompt = get_prompt(str(testdir) + os.sep) @@ -72,7 +72,7 @@ class TestFileCompletion: testdir = tmp_path / 'test' for directory in ['bar', 'foo']: - (testdir / directory).mkdir(exist_ok=True,parents=True) + (testdir / directory).mkdir(exist_ok=True, parents=True) prompt = get_prompt(str(testdir / 'foo') + os.sep) -- cgit v1.2.3-54-g00ecf From 79ed9036ec114140827fa08ccce1d512411b009c Mon Sep 17 00:00:00 2001 From: Lembrun Date: Thu, 11 Mar 2021 19:42:57 +0100 Subject: Removed exist_ok --- tests/unit/mainwindow/test_prompt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/mainwindow/test_prompt.py b/tests/unit/mainwindow/test_prompt.py index 5528a9bb9..668cd0710 100644 --- a/tests/unit/mainwindow/test_prompt.py +++ b/tests/unit/mainwindow/test_prompt.py @@ -58,7 +58,7 @@ class TestFileCompletion: """Simply trying to tab through items.""" testdir = tmp_path / 'test' for directory in 'abc': - (testdir / directory).mkdir(exist_ok=True, parents=True) + (testdir / directory).mkdir(parents=True) prompt = get_prompt(str(testdir) + os.sep) @@ -72,7 +72,7 @@ class TestFileCompletion: testdir = tmp_path / 'test' for directory in ['bar', 'foo']: - (testdir / directory).mkdir(exist_ok=True, parents=True) + (testdir / directory).mkdir(parents=True) prompt = get_prompt(str(testdir / 'foo') + os.sep) -- cgit v1.2.3-54-g00ecf