Skip to content

Commit 7e86f74

Browse files
fix tests
1 parent e66df11 commit 7e86f74

5 files changed

Lines changed: 10 additions & 13 deletions

File tree

.github/workflows/main.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ jobs:
3030
run: |
3131
task check-version
3232
33-
# TODO
34-
# - name: Run code linter
35-
# run: |
36-
# pip install ruff
37-
# task lint
33+
- name: Run code linter
34+
run: |
35+
pip install ruff
36+
task lint
3837
3938
test:
4039
needs: feature-branch-checks

pedantic/decorators/fn_deco_trace.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ def trace(func: F) -> F:
1818
... def my_function(a, b, c):
1919
... return a + b + c
2020
>>> my_function(4, 5, 6)
21-
Trace: ... calling my_function() with (4, 5, 6), {}
22-
Trace: ... my_function() returned 15
2321
15
2422
"""
2523

tests/decorators/pedantic/test_pedantic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ def test_binary_io_real_file():
19011901
@pedantic
19021902
def foo(a: BinaryIO) -> None: pass
19031903

1904-
with Path(file=TEST_FILE).open(mode='wb') as f:
1904+
with Path(TEST_FILE).open(mode='wb') as f:
19051905
foo(a=f)
19061906

19071907
Path(TEST_FILE).unlink(missing_ok=True)
@@ -1911,7 +1911,7 @@ def test_text_io_real_file():
19111911
@pedantic
19121912
def foo(a: TextIO) -> None: pass
19131913

1914-
with Path(file=TEST_FILE).open(mode='w') as f:
1914+
with Path(TEST_FILE).open(mode='w') as f:
19151915
foo(a=f)
19161916

19171917
Path(TEST_FILE).unlink()
@@ -2424,7 +2424,7 @@ def foo(cls, x: str) -> str:
24242424
class Child(Parent):
24252425
pass
24262426

2427-
assert Child.foo(x='bar') == 'Parent'
2427+
assert Child.foo(x='bar') == 'Parentbar'
24282428

24292429
with pytest.raises(PedanticTypeCheckException):
24302430
Child.foo(x=1)

tests/decorators/validate/test_parameter_environment_variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def bar(foo):
7070

7171

7272
def test_parameter_environment_variable_different_name():
73-
@validate(EnvironmentVariableParameter(name='FOO', env_var_name='fuu', value_type=str))
73+
@validate(EnvironmentVariableParameter(name='foo', env_var_name='FUU', value_type=str))
7474
def bar(foo):
7575
return foo
7676

tests/decorators/validate/test_validate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def bar(foo):
204204

205205
def test_external_parameter_mixed_with_normal_parameter():
206206
@validate(
207-
EnvironmentVariableParameter(name='FOO'),
207+
EnvironmentVariableParameter(name='foo'),
208208
Parameter(name='footer'),
209209
return_as=ReturnAs.KWARGS_WITHOUT_NONE,
210210
)
@@ -213,7 +213,7 @@ def bar(foo, footer):
213213

214214
assert bar('42', 3) == ('42', 3)
215215

216-
os.environ['FOO'] = '42'
216+
os.environ['foo'] = '42' # noqa: SIM112
217217
assert bar(footer=3) == ('42', 3)
218218

219219

0 commit comments

Comments
 (0)