Skip to content

Commit b63f21e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent af5bb88 commit b63f21e

7 files changed

Lines changed: 17 additions & 13 deletions

File tree

docs/create_markdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
2-
from pathlib import Path
32
import re
43
import subprocess
4+
from pathlib import Path
55

66

77
def get_filename(args):

test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
GIT2CPP_TEST_WASM = os.getenv("GIT2CPP_TEST_WASM") == "1"
99

1010
if GIT2CPP_TEST_WASM:
11-
from .conftest_wasm import * # noqa: F403
11+
from .conftest_wasm import *
1212

1313

1414
# Fixture to run test in current tmp_path

test/conftest_wasm.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Extra fixtures used for wasm testing, including some that override the default pytest fixtures.
2-
from functools import partial
32
import os
43
import pathlib
5-
from playwright.sync_api import Page
6-
import pytest
74
import re
85
import subprocess
96
import time
7+
from functools import partial
8+
9+
import pytest
10+
from playwright.sync_api import Page
1011

1112

1213
# Only include particular test files when testing wasm.
@@ -94,8 +95,7 @@ def read_bytes(self) -> bytes:
9495
def read_text(self) -> str:
9596
p = subprocess.run(["cat", str(self)], capture_output=True, text=True, check=True)
9697
text = p.stdout
97-
if text.endswith("\n"):
98-
text = text[:-1]
98+
text = text.removesuffix("\n")
9999
return text
100100

101101
def write_bytes(self, data: bytes):
@@ -110,8 +110,7 @@ def write_text(self, data: str):
110110
# Note that in general it is not valid to direct output of a subprocess.run call to a file,
111111
# but we get away with it here as the command arguments are passed straight through to
112112
# cockle without being checked.
113-
if data.endswith("\n"):
114-
data = data[:-1]
113+
data = data.removesuffix("\n")
115114
cmd = ["echo", data, ">", str(self)]
116115
subprocess.run(cmd, capture_output=True, text=True, check=True)
117116
return len(data)

test/test_clone.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import pytest
21
import subprocess
2+
3+
import pytest
4+
35
from .conftest import GIT2CPP_TEST_WASM
46

57
xtl_url = "https://github.com/xtensor-stack/xtl.git"

test/test_fixtures.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import re
44
import subprocess
5+
56
from .conftest import GIT2CPP_TEST_WASM
67

78

test/test_git.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import pytest
21
import re
32
import subprocess
3+
4+
import pytest
5+
46
from .conftest import GIT2CPP_TEST_WASM
57

68

wasm/recipe/modify-recipe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# This can be called repeatedly and will produce the same output.
33

44
import argparse
5-
from pathlib import Path
65
import shutil
7-
import yaml
6+
from pathlib import Path
87

8+
import yaml
99

1010
parser = argparse.ArgumentParser()
1111
parser.add_argument("input_directory", type=Path)

0 commit comments

Comments
 (0)