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

Use typing.NamedTuple instead of collections.namedtuple #822

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 2 additions & 3 deletions tests/test_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

import collections
import itertools
import os
import platform
import sys
from typing import cast
from typing import NamedTuple, cast
from unittest import mock

import pytest
Expand Down Expand Up @@ -94,7 +93,7 @@ def test_allows_prerelease(self):
)


FakeVersionInfo = collections.namedtuple(
FakeVersionInfo = NamedTuple(
"FakeVersionInfo", ["major", "minor", "micro", "releaselevel", "serial"]
)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_musllinux.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import collections
import pathlib
import subprocess
from typing import NamedTuple

import pretend
import pytest
Expand Down Expand Up @@ -60,7 +60,7 @@ def test_parse_musl_version(output, version):
)
def test_get_musl_version(monkeypatch, executable, output, version, ld_musl):
def mock_run(*args, **kwargs):
return collections.namedtuple("Proc", "stderr")(output)
return NamedTuple("Proc", "stderr")(output)

run_recorder = pretend.call_recorder(mock_run)
monkeypatch.setattr(_musllinux.subprocess, "run", run_recorder)
Expand Down
Loading