summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-23 17:29:42 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-23 17:29:42 +0100
commitc64733d2445131b383a7ed28e547ed3aff50cdb0 (patch)
tree29d977931e3445b381920ac93640a98329ca56a5
parent24ca7b7919f08cbef5578d83860f40553513ddae (diff)
downloadqutebrowser-c64733d2445131b383a7ed28e547ed3aff50cdb0.tar.gz
qutebrowser-c64733d2445131b383a7ed28e547ed3aff50cdb0.zip
Clean up and fix pathlib conversions
Subprocess arguments should be strings
-rw-r--r--tests/end2end/fixtures/quteprocess.py11
-rw-r--r--tests/end2end/fixtures/webserver.py8
2 files changed, 7 insertions, 12 deletions
diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py
index dcf7e2762..0fdc8dfcf 100644
--- a/tests/end2end/fixtures/quteprocess.py
+++ b/tests/end2end/fixtures/quteprocess.py
@@ -504,7 +504,7 @@ class QuteProc(testprocess.Process):
if hasattr(sys, 'frozen'):
if profile:
raise Exception("Can't profile with sys.frozen!")
- executable = pathlib.Path(sys.executable).parent / 'qutebrowser'
+ executable = str(pathlib.Path(sys.executable).parent / 'qutebrowser')
args = []
else:
executable = sys.executable
@@ -513,13 +513,10 @@ class QuteProc(testprocess.Process):
profile_id = '{}_{}'.format(self._instance_id,
next(self._run_counter))
profile_file = profile_dir / '{}.pstats'.format(profile_id)
- try:
- profile_dir.mkdir()
- except FileExistsError:
- pass
- args = [(pathlib.Path('scripts') / 'dev' / 'run_profile.py'),
+ profile_dir.mkdir(exist_ok=True)
+ args = [str(pathlib.Path('scripts') / 'dev' / 'run_profile.py'),
'--profile-tool', 'none',
- '--profile-file', profile_file]
+ '--profile-file', str(profile_file)]
else:
args = ['-bb', '-m', 'qutebrowser']
return executable, args
diff --git a/tests/end2end/fixtures/webserver.py b/tests/end2end/fixtures/webserver.py
index f36c8d445..0fc32cd88 100644
--- a/tests/end2end/fixtures/webserver.py
+++ b/tests/end2end/fixtures/webserver.py
@@ -171,14 +171,12 @@ class WebserverProcess(testprocess.Process):
def _executable_args(self):
if hasattr(sys, 'frozen'):
- executable = str(pathlib.Path(sys.executable).parent
- / self._script)
+ executable = str(pathlib.Path(sys.executable).parent / self._script)
args = []
else:
executable = sys.executable
- py_file = str((pathlib.Path(__file__).parent
- / self._script).with_suffix('.py'))
- args = [py_file]
+ py_file = (pathlib.Path(__file__).parent / self._script).with_suffix('.py')
+ args = [str(py_file)]
return executable, args
def _default_args(self):