diff options
author | Lembrun <amadeusk7@free.fr> | 2021-03-11 16:50:38 +0100 |
---|---|---|
committer | Lembrun <amadeusk7@free.fr> | 2021-03-11 16:50:38 +0100 |
commit | f2bfa3e34ce44988cce33ef4a8602ff9934b6f2f (patch) | |
tree | 477a6d012f92348143e2a32c544917e5fabf8369 /tests/end2end/fixtures/quteprocess.py | |
parent | b65c881407476423a1c544546a016f79ce7af254 (diff) | |
download | qutebrowser-f2bfa3e34ce44988cce33ef4a8602ff9934b6f2f.tar.gz qutebrowser-f2bfa3e34ce44988cce33ef4a8602ff9934b6f2f.zip |
Changed joinpath
Diffstat (limited to 'tests/end2end/fixtures/quteprocess.py')
-rw-r--r-- | tests/end2end/fixtures/quteprocess.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 745bc0f83..650c78047 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -502,21 +502,20 @@ class QuteProc(testprocess.Process): if hasattr(sys, 'frozen'): if profile: raise Exception("Can't profile with sys.frozen!") - executable = pathlib.Path(sys.executable).parent.joinpath('qutebrowser') + executable = pathlib.Path(sys.executable).parent / 'qutebrowser' args = [] else: executable = sys.executable if profile: - profile_dir = pathlib.Path(pathlib.Path.cwd() / 'prof') + profile_dir = pathlib.Path.cwd() / 'prof' profile_id = '{}_{}'.format(self._instance_id, next(self._run_counter)) - profile_file = pathlib.Path(profile_dir).joinpath( - '{}.pstats'.format(profile_id)) + profile_file = profile_dir / '{}.pstats'.format(profile_id) try: - pathlib.Path.mkdir(profile_dir) + profile_dir.mkdir() except FileExistsError: pass - args = [pathlib.Path('scripts').joinpath('dev', 'run_profile.py'), + args = [(pathlib.Path('scripts') / 'dev' / 'run_profile.py'), '--profile-tool', 'none', '--profile-file', profile_file] else: @@ -860,11 +859,11 @@ class QuteProc(testprocess.Process): def get_session(self): """Save the session and get the parsed session data.""" with tempfile.TemporaryDirectory() as tmpdir: - session = pathlib.Path(tmpdir).joinpath('session.yml') + session = pathlib.Path(tmpdir) / 'session.yml' self.send_cmd(':session-save --with-private "{}"'.format(session)) self.wait_for(category='message', loglevel=logging.INFO, message='Saved session {}.'.format(session)) - with open(session, encoding='utf-8') as f: + with session.open(encoding='utf-8') as f: data = f.read() self._log('\nCurrent session data:\n' + data) @@ -873,7 +872,7 @@ class QuteProc(testprocess.Process): def get_content(self, plain=True): """Get the contents of the current page.""" with tempfile.TemporaryDirectory() as tmpdir: - path = pathlib.Path(tmpdir / 'page') + path = pathlib.Path(tmpdir) / 'page' if plain: self.send_cmd(':debug-dump-page --plain "{}"'.format(path)) @@ -883,7 +882,7 @@ class QuteProc(testprocess.Process): self.wait_for(category='message', loglevel=logging.INFO, message='Dumped page to {}.'.format(path)) - with open(path, 'r', encoding='utf-8') as f: + with path.open('r', encoding='utf-8') as f: return f.read() def get_screenshot( |