Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attrs redone #3058

Merged
merged 5 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/trio/_tests/test_trio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def test_trio_import() -> None:
import sys

for module in list(sys.modules.keys()):
if module.startswith("trio"):
del sys.modules[module]

import trio # noqa: F401
6 changes: 5 additions & 1 deletion src/trio/_tests/tools/test_mypy_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def test_endtoend(
monkeypatch: pytest.MonkeyPatch,
capsys: pytest.CaptureFixture[str],
) -> None:
import trio._tools.mypy_annotate as mypy_annotate

inp_text = """\
Mypy begun
trio/core.py:15: error: Bad types here [misc]
Expand All @@ -116,7 +118,9 @@ def test_endtoend(
with monkeypatch.context():
monkeypatch.setattr(sys, "stdin", io.StringIO(inp_text))

main(["--dumpfile", str(result_file), "--platform", "SomePlatform"])
mypy_annotate.main(
["--dumpfile", str(result_file), "--platform", "SomePlatform"]
)

std = capsys.readouterr()
assert std.err == ""
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def current_default_thread_limiter() -> CapacityLimiter:
# system; see https://github.com/python-trio/trio/issues/182
# But for now we just need an object to stand in for the thread, so we can
# keep track of who's holding the CapacityLimiter's token.
@attrs.frozen(eq=False, hash=False, slots=False)
@attrs.frozen(eq=False, slots=False)
class ThreadPlaceholder:
name: str

Expand Down
Loading