Skip to content

Commit 0526401

Browse files
committed
test: fix lint issues
1 parent 4a5908e commit 0526401

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ adheres to [Semantic Versioning](https://semver.org/).
1414
- Add tests for CPython 3.10 and PyPy 3.8
1515
- Use CPython 3.10 for misc. tests
1616
- Clarify which Python versions are supported in readme
17+
- Fix some linting issues found by latest versions of mypy/pylint
1718

1819
## [0.3.0] - 2021-11-07
1920

tests/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ def pytest_addoption(parser: "Parser") -> None:
2626
def pytest_collection_modifyitems(config: "Config", items: "List[Item]") -> None:
2727
root = Path(__file__).parent.parent
2828
for item in items:
29-
relative = Path(item.fspath).parent.relative_to(root)
30-
mark = relative.name
31-
item.add_marker(getattr(pytest.mark, mark))
29+
if item.fspath:
30+
relative = Path(item.fspath).parent.relative_to(root)
31+
mark = relative.name
32+
item.add_marker(getattr(pytest.mark, mark))
3233
if not config.getoption("--generate-integration-files"):
3334
skip_mark = pytest.mark.skip(
3435
reason="need --generate-integration-files option to run"

tests/unit/test_iocombiner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def test_truncate() -> None:
289289

290290
# truncate at start
291291
combiner.truncate(0)
292-
assert dict(combiner._fileobjs) == {}
292+
assert not dict(combiner._fileobjs)
293293
assert not originals[0].method_calls
294294

295295

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ commands =
4242
pylint src
4343
# - pass all files in tests as args because there are no __init__.py
4444
# - use bash to expend globs https://github.com/tox-dev/tox/issues/1571
45-
bash -c "shopt -s globstar; pylint -d duplicate-code,too-many-statements tests/**/*.py"
45+
bash -c "shopt -s globstar; pylint -d duplicate-code,too-many-statements,use-implicit-booleaness-not-comparison tests/**/*.py"
4646

4747
[testenv:format]
4848
skip_install = true

0 commit comments

Comments
 (0)