Skip to content

Commit 747ce97

Browse files
committed
[TestSlide] Fix CI on Github
1 parent 65ed031 commit 747ce97

11 files changed

Lines changed: 28 additions & 28 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: ["3.7", "3.8", "3.9", "3.10"]
11+
python-version: ["3.8", "3.9", "3.10"]
1212
# Ensure that all flavours are run to completion even if an other flavor failed
1313
fail-fast: false
1414

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ flake8: venv
117117
@printf "${TERM_BRIGHT}FLAKE8 ${ALL_SRCS}\n${TERM_NONE}"
118118
${Q} ${CURDIR}/venv/bin/flake8 --select=F,C90 $(ALL_SRCS)
119119

120-
.PHONY: black
121-
black: venv
122-
@printf "${TERM_BRIGHT}BLACK ${ALL_SRCS}\n${TERM_NONE}"
123-
${Q} ${CURDIR}/venv/bin/black --check --diff $(ALL_SRCS) || { echo "Formatting errors found, try running 'make format'."; exit 1; }
120+
.PHONY: ruff
121+
ruff: venv
122+
@printf "${TERM_BRIGHT}RUFF check ${ALL_SRCS}\n${TERM_NONE}"
123+
${Q} ${CURDIR}/venv/bin/ruff check --diff $(ALL_SRCS) || { echo "Formatting errors found, try running 'make format'."; exit 1; }
124124

125-
.PHONY: format_black
126-
format_black: venv
125+
.PHONY: format_ruff
126+
format_ruff: venv
127127
@printf "${TERM_BRIGHT}FORMAT BLACK ${ALL_SRCS}\n${TERM_NONE}"
128-
${Q} ${CURDIR}/venv/bin/black $(ALL_SRCS)
128+
${Q} ${CURDIR}/venv/bin/ruff format $(ALL_SRCS)
129129

130130
.PHONY: tests
131131
tests: \
@@ -134,12 +134,12 @@ tests: \
134134
pytest_tests \
135135
mypy \
136136
flake8 \
137-
black \
137+
ruff \
138138
check-copyright
139139

140140
.PHONY: format
141141
format: \
142-
format_black
142+
format_ruff
143143
@true
144144
##
145145
## Coverage

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
black
1+
ruff
22
coverage
33
coveralls
44
flake8

testslide/bdd/dsl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def nest_context(self, name: str, *args: Any, **kwargs: Any) -> None:
201201
raise TypeError('Shared context "{}" does not exist'.format(name))
202202
self._create_context(
203203
name,
204-
self.current_context.all_shared_contexts[name],
204+
self.current_context.all_shared_contexts[name], # type: ignore
205205
*args,
206206
**kwargs, # type: ignore
207207
)

testslide/bdd/lib.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def addError( # type:ignore
429429
# inconsistently.
430430
def addFailure( # type:ignore
431431
self,
432-
test: "TestCase",
432+
test: "TestCase", # type: ignore
433433
err: Tuple[
434434
Type[BaseException],
435435
BaseException,
@@ -456,9 +456,9 @@ def addUnexpectedSuccess(self, test: "TestCase") -> None: # type: ignore
456456
# pyre-ignore
457457
def addSubTest(
458458
self,
459-
test: "TestCase",
460-
subtest: "TestCase",
461-
err: Tuple[
459+
test: "TestCase", # type: ignore
460+
subtest: "TestCase", # type: ignore
461+
err: Tuple[ # type: ignore
462462
Optional[Type[BaseException]],
463463
Optional[BaseException],
464464
Optional[types.TracebackType],
@@ -532,7 +532,7 @@ class Context:
532532
def __init__(
533533
self,
534534
name: str,
535-
parent_context: Optional["Context"] = None,
535+
parent_context: Optional["Context"] = None, # type: ignore
536536
shared: bool = False,
537537
skip: bool = False,
538538
focus: bool = False,

testslide/cli.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pyre-unsafe
22
from testslide.executor.cli import *
3-
from testslide.executor.import_profiler import ImportedModule, ImportProfiler
3+
from testslide.executor.import_profiler import ImportedModule, ImportProfiler # noqa
44

55
# pyre-fixme[21]: Could not find name `AggregatedExceptions` in
66
# `testslide.executor.lib`.

testslide/core/mock_callable.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _is_coroutine(obj: Any) -> bool:
170170
return inspect.iscoroutine(obj) or isinstance(
171171
obj,
172172
# pyre-ignore
173-
asyncio.coroutines.CoroWrapper,
173+
asyncio.coroutines.CoroWrapper, # type: ignore
174174
)
175175
else:
176176
return inspect.iscoroutine(obj)
@@ -1014,7 +1014,7 @@ def to_raise(
10141014
_RaiseRunner(
10151015
self._original_target,
10161016
self._method,
1017-
self._original_callable,
1017+
self._original_callable, # type: ignore
10181018
ex, # type: ignore
10191019
)
10201020
)
@@ -1023,7 +1023,7 @@ def to_raise(
10231023
_RaiseRunner(
10241024
self._original_target,
10251025
self._method,
1026-
self._original_callable,
1026+
self._original_callable, # type: ignore
10271027
ex(), # type: ignore
10281028
)
10291029
)
@@ -1246,7 +1246,7 @@ def with_implementation(self, func: Callable) -> "_MockAsyncCallableDSL":
12461246
_AsyncImplementationRunner(
12471247
self._original_target,
12481248
self._method,
1249-
self._original_callable,
1249+
self._original_callable, # type: ignore
12501250
func, # type: ignore
12511251
)
12521252
)

testslide/core/mock_constructor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def mock_constructor(
341341

342342
if target_class_id in _mocked_target_classes:
343343
original_class, mocked_class = _mocked_target_classes[target_class_id]
344-
if not getattr(target, class_name) is mocked_class:
344+
if getattr(target, class_name) is not mocked_class:
345345
raise AssertionError(
346346
"The class {} at {} was changed after mock_constructor() mocked "
347347
"it!".format(class_name, target)

testslide/executor/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def example_code(self: Any) -> None:
158158
"{}.{}".format(
159159
test_case.__module__,
160160
# pyre-ignore
161-
test_case.__name__,
161+
test_case.__name__, # type: ignore
162162
)
163163
)(get_context_code(test_case))
164164

testslide/executor/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ def finish(self, not_executed_examples: List[Example]) -> None:
532532
print("")
533533
self.print_failed_example(
534534
number + 1,
535-
result["example"],
535+
result["example"], # type: ignore
536536
result["exception"], # type: ignore
537537
)
538538
print("")

0 commit comments

Comments
 (0)